Repository navigation
Generated #1150
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Version to release (semver, "auto", "major", "minor", "patch") | |
| default: minor | |
| required: false | |
| force: | |
| description: Force release | |
| default: false | |
| type: boolean | |
| merge_target: | |
| description: Merge target branch | |
| default: main | |
| required: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| name: Release a new version | |
| # Craft merges release branches by SHA, producing "Merge commit '...'". | |
| if: >- | |
| github.event_name == 'workflow_dispatch' || | |
| ( | |
| !startsWith(github.event.head_commit.message, 'Merge branch ''release/') && | |
| !(github.actor == 'sentry-release-bot[bot]' && | |
| startsWith(github.event.head_commit.message, 'Merge commit ')) | |
| ) | |
| # Apply concurrency after the guard so skipped merges cannot cancel a release. | |
| concurrency: | |
| group: release | |
| cancel-in-progress: true | |
| steps: | |
| - name: Get auth token | |
| id: token | |
| uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0 | |
| with: | |
| app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} | |
| private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| token: ${{ steps.token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 24 | |
| - name: Prepare release | |
| uses: getsentry/craft@f4889d04564e47311038ecb6b910fef6b6cf1363 # v2 | |
| env: | |
| GITHUB_TOKEN: ${{ steps.token.outputs.token }} | |
| with: | |
| version: ${{ inputs.version }} | |
| force: ${{ inputs.force }} | |
| merge_target: ${{ inputs.merge_target || 'main' }} |