Skip to content

Commit

Permalink
chore: add release gamma branch
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobonamin committed Jan 15, 2024
1 parent 80bc91e commit 6c11f4f
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 33 deletions.
52 changes: 19 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
- beta
- next
- main
- gamma

permissions:
contents: read # for checkout
Expand Down Expand Up @@ -50,41 +49,28 @@ jobs:
cypress/screenshots
cypress/videos
release-please:
release:
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
name: 'Semantic release'
needs: test
runs-on: ubuntu-latest
steps:
- uses: tibdex/github-app-token@v2 # v2
id: generate-token
with:
app_id: ${{ secrets.ECOSPARK_APP_ID }}
private_key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
# This action will create a release PR when regular conventional commits are pushed to main, it'll also detect if a release PR is merged and npm publish should happen
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
command: manifest
token: ${{ steps.generate-token.outputs.token }}

# Publish to NPM on new releases
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created }}
- uses: pnpm/action-setup@v2
if: ${{ steps.release.outputs.releases_created }}
- uses: actions/setup-node@v3
if: ${{ steps.release.outputs.releases_created }}
with:
cache: pnpm
# Need to fetch entire commit history to
# analyze every commit since last release
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: install deps & build
run: corepack enable && pnpm --version && pnpm install --ignore-scripts
if: ${{ steps.release.outputs.releases_created }}
- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
if: ${{ steps.release.outputs.releases_created }}
- run: corepack enable && pnpm --version
- run: pnpm install
# Branches that will release new versions are defined in .releaserc.json
- run: pnpm exec semantic-release
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
# Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to NPM here
- run: pnpm -r publish
if: ${{ steps.release.outputs.releases_created }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/release-gamma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Release (gamma)

on:
push:
branches:
- gamma

permissions:
contents: read

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2
id: generate-token
with:
app_id: ${{ secrets.ECOSPARK_APP_ID }}
private_key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
# This action will create a release PR when regular conventional commits are pushed to gamma, it'll also detect if a release PR is merged and npm publish should happen
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
default-branch: gamma
command: manifest
token: ${{ steps.generate-token.outputs.token }}

# Publish to NPM on new releases
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created }}
- uses: pnpm/action-setup@v2
if: ${{ steps.release.outputs.releases_created }}
- uses: actions/setup-node@v3
if: ${{ steps.release.outputs.releases_created }}
with:
cache: pnpm
node-version: lts/*
- name: install deps & build
run: corepack enable && pnpm --version && pnpm install --ignore-scripts
if: ${{ steps.release.outputs.releases_created }}
- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
if: ${{ steps.release.outputs.releases_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
# Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to NPM here
- run: pnpm -r publish
if: ${{ steps.release.outputs.releases_created }}
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"@sanity/ui": "2.0.0-gamma.0"}
9 changes: 9 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"bump-minor-pre-major": true,
"packages": {
"@sanity/ui": {
"prerelease": true
}
}
}

0 comments on commit 6c11f4f

Please sign in to comment.