Release notes 3.14.7 #1
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
| # When a branch named release/X.Y.Z is pushed, set version = "X.Y.Z" in setup.py and commit. | |
| # Branch name must match release/X.Y.Z (e.g. release/3.14.7). Creates one commit if version changed. | |
| name: Release version bump | |
| on: | |
| push: | |
| branches: | |
| - "release/*" | |
| jobs: | |
| bump: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # push commit to release branch | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.ref }} | |
| - name: Get version from branch name | |
| id: version | |
| run: | | |
| BRANCH="${{ github.ref_name }}" | |
| if [[ "$BRANCH" =~ ^release/(.+)$ ]]; then | |
| echo "version=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "Branch name must be release/X.Y.Z" | |
| exit 1 | |
| fi | |
| - name: Update version in setup.py | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| sed -i 's/^version = ".*"/version = "'"$VERSION"'"/' setup.py | |
| grep -q '^version = "'"$VERSION"'"' setup.py || (echo "Failed to update setup.py"; exit 1) | |
| - name: Commit and push if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| if git diff --quiet setup.py; then | |
| echo "Version already set, nothing to commit" | |
| exit 0 | |
| fi | |
| git add setup.py | |
| git commit -m "chore: set version to ${{ steps.version.outputs.version }} [skip ci]" | |
| git push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |