v1.1.2 #10
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: "Release" | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Extract Major and Minor Versions from Tag | |
| id: extract-version | |
| run: | | |
| TAG_NAME="${{ github.event.release.tag_name }}" | |
| if [[ "$TAG_NAME" =~ ^v([0-9]+)\.([0-9]+) ]]; then | |
| MAJOR="${BASH_REMATCH[1]}" | |
| MINOR="${BASH_REMATCH[2]}" | |
| echo "MAJOR=$MAJOR" >> $GITHUB_ENV | |
| echo "MINOR=$MINOR" >> $GITHUB_ENV | |
| echo "Extracted Major: $MAJOR, Minor: $MINOR" | |
| else | |
| echo "Invalid tag format: $TAG_NAME" | |
| exit 1 | |
| fi | |
| - name: Update package.json version | |
| run: | | |
| TAG="${{ github.event.release.tag_name }}" | |
| NEW_VERSION="${TAG#v}" | |
| npm version $NEW_VERSION --no-git-tag-version | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add package.json | |
| git commit -m "chore: bump version to $NEW_VERSION" | |
| - name: Update Major and Minor Tags | |
| run: | | |
| git tag -f v$MAJOR | |
| git tag -f v$MAJOR.$MINOR | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| tags: true | |
| force: true |