Skip to content

Commit e947af7

Browse files
Antony BaileyAntony Bailey
authored andcommitted
ver update
1 parent bcdb5a8 commit e947af7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/tag.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,23 @@ jobs:
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

0 commit comments

Comments
 (0)