Repository navigation
Release #62
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: | |
| workflow_dispatch: | |
| inputs: | |
| product: | |
| description: Product to release | |
| required: true | |
| type: choice | |
| default: mcp | |
| options: | |
| - cli | |
| - mcp | |
| bump: | |
| description: Version bump type | |
| required: true | |
| type: choice | |
| default: minor | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| force: | |
| description: Force release (bypass blockers) | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| name: "Release a new version" | |
| steps: | |
| - name: Get auth token | |
| id: token | |
| uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 | |
| with: | |
| app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} | |
| private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| with: | |
| token: ${{ steps.token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: "22" | |
| - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda | |
| name: Install pnpm | |
| with: | |
| run_install: false | |
| - name: Resolve release workspace | |
| id: release | |
| env: | |
| PRODUCT: ${{ inputs.product }} | |
| run: | | |
| case "$PRODUCT" in | |
| cli) | |
| workspace=packages/cli | |
| package_path=packages/cli | |
| ;; | |
| mcp) | |
| workspace=packages/mcp-server | |
| package_path=packages/mcp-server | |
| ;; | |
| *) | |
| echo "::error::Unsupported product: $PRODUCT" | |
| exit 1 | |
| ;; | |
| esac | |
| { | |
| echo "workspace=$workspace" | |
| echo "package_path=$package_path" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Calculate version | |
| id: version | |
| env: | |
| BUMP: ${{ inputs.bump }} | |
| PACKAGE_PATH: ${{ steps.release.outputs.package_path }} | |
| run: | | |
| CURRENT=$(node -p "require('./$PACKAGE_PATH/package.json').version") | |
| NEW=$(npm exec --yes --package=semver@7.7.2 -- semver -i "$BUMP" "$CURRENT") | |
| echo "version=$NEW" >> "$GITHUB_OUTPUT" | |
| - name: Prepare release | |
| uses: getsentry/craft@25028d0646040cc0a669ae3314cbf884f4c4347a # v2 | |
| env: | |
| GITHUB_TOKEN: ${{ steps.token.outputs.token }} | |
| with: | |
| workspace: ${{ steps.release.outputs.workspace }} | |
| version: ${{ steps.version.outputs.version }} | |
| force: ${{ inputs.force && 'true' || '' }} |