chore(main): release 1.24.1 (#601) #22
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: tag:auto-create | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - "[0-9]+.[0-9]+.[0-9]+*" | |
| - "[0-9]+.[0-9]+" | |
| - "[0-9]+" | |
| paths: | |
| - CHANGELOG.md | |
| jobs: | |
| release: | |
| name: Create release tag | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Relabel closed release PR | |
| env: | |
| GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }} | |
| run: | | |
| PR_NUMBER=$(gh pr list --state closed --label "autorelease: pending" --limit 1 --json number -q '.[0].number') | |
| gh pr edit $PR_NUMBER --remove-label "autorelease: pending" | |
| gh pr edit $PR_NUMBER --add-label "autorelease: tagged" | |
| - name: Get version from CHANGELOG.md | |
| id: get_version | |
| run: | | |
| VERSION=$(grep -m1 '^#\+ \[[0-9]\+\.[0-9]\+\.[0-9]\+\]' CHANGELOG.md | sed -E 's/^#+ \[([0-9]+\.[0-9]+\.[0-9]+)\].*/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Create tag via GitHub API | |
| env: | |
| GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }} | |
| run: | | |
| TAG="v${{ steps.get_version.outputs.version }}" | |
| if gh api repos/${{ github.repository }}/git/ref/tags/$TAG &>/dev/null; then | |
| echo "Tag $TAG already exists. Skipping..." | |
| exit 0 | |
| fi | |
| COMMIT_SHA=$(git rev-parse HEAD) | |
| gh api repos/${{ github.repository }}/git/refs \ | |
| -f ref="refs/tags/$TAG" \ | |
| -f sha="$COMMIT_SHA" |