Skip to content

Commit 85bb7ce

Browse files
authored
Update version in setup.py when release
2 parents 71a35be + 1cc9190 commit 85bb7ce

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
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: GPL-3.0-only
2121
Files: requirements*.txt
2222
Copyright: 2021 LG Electronics
2323
License: LicenseRef-3rd_party_licenses
24+
25+
Files: .bumpversion.cfg
26+
Copyright: 2021 LG Electronics
27+
License: GPL-3.0-only

src/fosslight_reuse/_fosslight_reuse.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
from reuse.report import ProjectReport
1919

2020
_PKG_NAME = "fosslight_reuse"
21-
_MSG_REFERENCE = "Ref. Copyright and License Writing Rules in Source Code. : http://collab.lge.com/main/x/1eb-LQ"
22-
_MSG_FOLLOW_LIC_TXT = "Follow the Copyright and License Writing Rules in Source Code. : http://collab.lge.com/main/x/1eb-LQ"
21+
_RULE_LINK = "https://oss.lge.com/guide/process/osc_process/1-identification/copyright_license_rule.html"
22+
_MSG_REFERENCE = "Ref. Copyright and License Writing Rules in Source Code. : " + _RULE_LINK
23+
_MSG_FOLLOW_LIC_TXT = "Follow the Copyright and License Writing Rules in Source Code. : " + _RULE_LINK
2324
_REUSE_CONFIG_FILE = ".reuse/dep5"
2425
_DEFAULT_EXCLUDE_EXTENSION_FILES = [] # Exclude files from reuse
2526
_DEFAULT_EXCLUDE_EXTENSION = ["jar", "png", "exe", "so", "a", "dll", "jpeg", "jpg", "ttf", "lib", "ttc", "pfb",

0 commit comments

Comments
 (0)