File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1717 with :
1818 fetch-depth : ' 0'
1919 - name : Bump version and push tag
20+ id : tag
2021 uses : anothrNick/github-tag-action@master
2122 env :
2223 GITHUB_TOKEN : ${{ secrets.TAG_TOKEN }}
2324 WITH_V : true
25+ - name : Update package version
26+ if : steps.tag.outputs.new_tag
27+ run : |
28+ # Extract version without the 'v' prefix
29+ VERSION=${GITHUB_REF_NAME#v}
30+ # For a Python package
31+ sed -i "s/version=.*,/version='${VERSION}',/" setup.py
32+ # OR for projects using pyproject.toml
33+ # sed -i "s/version = .*/version = \"${VERSION}\"/" pyproject.toml
34+
35+ git config --local user.email "action@github.com"
36+ git config --local user.name "GitHub Action"
37+ git add .
38+ git commit -m "chore: bump version to ${VERSION}"
39+ git push
You can’t perform that action at this time.
0 commit comments