File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Bump version files on tag push
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ jobs :
9+ bump-version :
10+ name : Update version files
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : write
14+
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Extract version from tag
22+ id : tag
23+ run : echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
24+
25+ - name : Update pyproject.toml and conf.py
26+ run : |
27+ VERSION=${{ steps.tag.outputs.VERSION }}
28+ echo "🔧 Setting version to $VERSION"
29+ sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
30+ sed -i "s/^release = \".*\"/release = \"$VERSION\"/" docs/conf.py
31+ sed -i "s/^version = \".*\"/version = \"${VERSION%.*}\"/" docs/conf.py
32+
33+ - name : Commit and push version updates
34+ run : |
35+ git config user.name "github-actions"
36+ git config user.email "github-actions@users.noreply.github.com"
37+ git commit -am "Auto bump version files to ${{ steps.tag.outputs.VERSION }}"
38+ git push origin HEAD:main
You can’t perform that action at this time.
0 commit comments