File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 1111
1212 release-build :
1313 runs-on : ubuntu-latest
14+ if : startsWith(github.ref, 'refs/tags/')
1415
1516 steps :
1617 - uses : actions/checkout@v4
1920 with :
2021 python-version : " 3.x"
2122
23+ - name : Update package.json version
24+ run : |
25+ TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})
26+ sed -i "s/version=.*,/version='$TAG_NAME',/" setup.py
27+
28+ - name : Commit and push changes
29+ run : |
30+ git config --global user.name 'github-actions[bot]'
31+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
32+ git add setup.py
33+ git commit -m "Update setup.py version to $TAG_NAME"
34+ git tag -f $TAG_NAME
35+ git push --force origin $TAG_NAME
36+ git push
37+ env :
38+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39+
2240 - name : build release distributions
2341 run : |
2442 pip install setuptools
3250
3351 pypi-publish :
3452 runs-on : ubuntu-latest
35- if : ${{ github.ref == 'refs/heads/main' }}
53+ if : startsWith( github.ref, 'refs/tags/')
3654 needs :
3755 - release-build
3856 permissions :
You can’t perform that action at this time.
0 commit comments