Skip to content

Commit

Permalink
Update version in setup.py when released
Browse files Browse the repository at this point in the history
  • Loading branch information
bjk7119 committed Jul 27, 2021
1 parent 54833ce commit f954026
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[bumpversion]
commit = True
tag = False
message = Bump version: {current_version} → {new_version}

[bumpversion:file:setup.py]
search='{current_version}'
replace='{new_version}'
22 changes: 22 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get Release
uses: agners/[email protected]
id: get_release
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
- name: Bump up version
env:
NEW_TAG: ${{ steps.get_release.outputs.tag_name }}
run: |
pip install --upgrade bumpversion
LAST_TWO_TAGS=$(git for-each-ref refs/tags/ --count=2 --sort=-v:refname --format="%(refname:short)")
LAST_ONE=$(echo $LAST_TWO_TAGS | cut -d' ' -f 2)
last_version=$(echo ${LAST_ONE//v/""})
echo Last version: ${last_version}
new_version=$(echo ${NEW_TAG//v/""})
echo New version: ${new_version}
git config --local user.name "github-actions[bot]"
bumpversion --current-version $last_version --new-version $new_version setup.py
- name: update changelog with gren
env:
GREN_GITHUB_TOKEN: ${{ secrets.TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ License: Apache-2.0
Files: requirements*.txt
Copyright: 2021 LG Electronics
License: Apache-2.0

Files: .bumpversion.cfg
Copyright: 2021 LG Electronics
License: Apache-2.0

0 comments on commit f954026

Please sign in to comment.