Skip to content

Commit f954026

Browse files
committed
Update version in setup.py when released
1 parent 54833ce commit f954026

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

.bumpversion.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[bumpversion]
2+
commit = True
3+
tag = False
4+
message = Bump version: {current_version} → {new_version}
5+
6+
[bumpversion:file:setup.py]
7+
search='{current_version}'
8+
replace='{new_version}'

.github/workflows/publish-release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,28 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Get Release
18+
uses: agners/[email protected]
19+
id: get_release
20+
env:
21+
GITHUB_TOKEN: ${{ github.token }}
22+
with:
23+
tag_name: ${{ github.ref }}
24+
- name: Bump up version
25+
env:
26+
NEW_TAG: ${{ steps.get_release.outputs.tag_name }}
27+
run: |
28+
pip install --upgrade bumpversion
29+
LAST_TWO_TAGS=$(git for-each-ref refs/tags/ --count=2 --sort=-v:refname --format="%(refname:short)")
30+
LAST_ONE=$(echo $LAST_TWO_TAGS | cut -d' ' -f 2)
31+
last_version=$(echo ${LAST_ONE//v/""})
32+
echo Last version: ${last_version}
33+
new_version=$(echo ${NEW_TAG//v/""})
34+
echo New version: ${new_version}
35+
git config --local user.name "github-actions[bot]"
36+
bumpversion --current-version $last_version --new-version $new_version setup.py
1537
- name: update changelog with gren
1638
env:
1739
GREN_GITHUB_TOKEN: ${{ secrets.TOKEN }}

.reuse/dep5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ License: Apache-2.0
2121
Files: requirements*.txt
2222
Copyright: 2021 LG Electronics
2323
License: Apache-2.0
24+
25+
Files: .bumpversion.cfg
26+
Copyright: 2021 LG Electronics
27+
License: Apache-2.0

0 commit comments

Comments
 (0)