chore(release): bump version to 3.1.1 (#152) #46
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 After Bump | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - CHANGELOG.md | |
| - novel_downloader/__init__.py | |
| permissions: | |
| contents: write | |
| jobs: | |
| tag: | |
| if: "${{ startsWith(github.event.head_commit.message, 'chore(release): bump version to') }}" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Extract version from commit message | |
| id: extract | |
| run: | | |
| VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP 'bump version to \K[0-9]+\.[0-9]+\.[0-9]+') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Create and push tag | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag "v${{ steps.extract.outputs.version }}" | |
| git push origin "v${{ steps.extract.outputs.version }}" |