Cut Release #4
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: Cut Release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.WORKFLOW_TOKEN }} | |
| - name: Bump frontend version | |
| run: | | |
| cd frontend | |
| yarn version --patch --no-git-tag-version | |
| - name: Get the latest tag | |
| id: get_latest_tag | |
| env: | |
| GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} | |
| run: | | |
| latest_tag=$(gh release list --limit 1 --json tagName -q '.[0].tagName') | |
| echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT | |
| - name: Bump version | |
| id: bump_version | |
| run: | | |
| latest_tag=${{ steps.get_latest_tag.outputs.latest_tag }} | |
| IFS='.' read -r -a version_parts <<< "${latest_tag#v}" | |
| major=${version_parts[0]} | |
| minor=${version_parts[1]} | |
| patch=${version_parts[2]} | |
| new_patch=$((patch + 1)) | |
| new_tag="v${major}.${minor}.${new_patch}" | |
| echo "::set-output name=new_tag::$new_tag" | |
| - name: Create and push new tag | |
| run: | | |
| new_tag=${{ steps.bump_version.outputs.new_tag }} | |
| git config user.name "github-actions" | |
| git config user.email "[email protected]" | |
| git tag $new_tag | |
| git push origin $new_tag |