chore(release): MAJOR version upgrade #4
Workflow file for this run
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: Version Bump | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'release/v[0-9]*' | |
| jobs: | |
| check-commit: | |
| name: Check Commit for Version Bump | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| should-bump: ${{ steps.check.outputs.should-bump }} | |
| bump-type: ${{ steps.check.outputs.bump-type }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Check for version bump commit | |
| id: check | |
| run: | | |
| COMMIT_MSG=$(git log -1 --pretty=%B) | |
| if [[ "$COMMIT_MSG" =~ (release:|chore\(release\):).*(MINOR|MAJOR) ]]; then | |
| echo "Version bump commit detected" | |
| if [[ "$COMMIT_MSG" == *"MINOR"* ]]; then | |
| echo "Bump type: MINOR" | |
| echo "bump-type=minor" >> $GITHUB_OUTPUT | |
| elif [[ "$COMMIT_MSG" == *"MAJOR"* ]]; then | |
| echo "Bump type: MAJOR" | |
| echo "bump-type=major" >> $GITHUB_OUTPUT | |
| else | |
| echo "Bump type: PATCH (default)" | |
| echo "bump-type=patch" >> $GITHUB_OUTPUT | |
| fi | |
| echo "should-bump=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Not a version bump commit, skipping" | |
| echo "should-bump=false" >> $GITHUB_OUTPUT | |
| fi | |
| publish: | |
| name: Publish Package | |
| needs: [check-commit] | |
| if: needs.check-commit.outputs.should-bump == 'true' | |
| uses: ./.github/workflows/publish-core.yml | |
| with: | |
| version_bump: ${{ needs.check-commit.outputs.bump-type }} | |
| npm_tag: '' # Will be auto-detected based on branch | |
| dry_run: false | |
| branch_name: ${{ github.ref_name }} | |
| secrets: | |
| NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} |