Release Production (SDK) #1
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 Production (SDK) | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version_type: | ||
| description: 'Version bump type' | ||
| required: true | ||
| default: 'patch' | ||
| type: choice | ||
| options: | ||
| - patch | ||
| - minor | ||
| - major | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| # First job: Prepare production release | ||
| prepare-and-commit-prod: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| new_version: ${{ steps.bump_version.outputs.new_version }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| - uses: ./.github/actions/setup-project | ||
| - name: Calculate and update production version | ||
| id: bump_version | ||
| run: | | ||
| cd sdk | ||
| # Get current version and bump it | ||
| CURRENT_VERSION=$(bun -e "console.log(require('./package.json').version)") | ||
| echo "Current version: $CURRENT_VERSION" | ||
| # Bump version based on input | ||
| npm version ${{ inputs.version_type }} --no-git-tag-version | ||
| NEW_VERSION=$(bun -e "console.log(require('./package.json').version)") | ||
| echo "New production version: $NEW_VERSION" | ||
| echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT | ||
| - name: Configure git | ||
| run: | | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
| - name: Commit and push version bump | ||
| run: | | ||
| git stash | ||
| git pull --rebase origin main | ||
| git stash pop | ||
| git add sdk/package.json | ||
| git commit -m "Bump SDK version to ${{ steps.bump_version.outputs.new_version }}" | ||
| git push | ||
| - name: Create and push production tag | ||
| run: | | ||
| git tag "sdk-v${{ steps.bump_version.outputs.new_version }}" | ||
| git push origin "sdk-v${{ steps.bump_version.outputs.new_version }}" | ||
| - name: Upload updated package | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: updated-sdk-package | ||
| path: sdk/ | ||
| build-and-publish-sdk: | ||
|
Check failure on line 73 in .github/workflows/sdk-release-prod.yml
|
||
| needs: prepare-and-commit-prod | ||
| uses: ./.github/workflows/sdk-release-build.yml | ||
| with: | ||
| new-version: ${{ needs.prepare-and-commit-prod.outputs.new_version }} | ||
| artifact-name: updated-sdk-package | ||
| checkout-ref: ${{ github.sha }} | ||
| secrets: inherit | ||