Skip to content

Commit d4fd292

Browse files
committed
Modify the version update to be automatic
1 parent 50f38df commit d4fd292

File tree

5 files changed

+41
-5
lines changed

5 files changed

+41
-5
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/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
## Description
2-
(Please describe what this PR do.)
3-
2+
<!--
3+
Please describe what this PR do.
4+
-->
45

56
## Type of change
7+
<!--
68
Please insert 'x' one of the type of change.
9+
-->
710
- [ ] Bug fix (non-breaking change which fixes an issue)
811
- [ ] New feature (non-breaking change which adds functionality)
912
- [ ] Documentation update

.github/workflows/publish-release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@ 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+
- name: Bump up version
23+
env:
24+
NEW_TAG: ${{ steps.get_release.outputs.tag_name }}
25+
run: |
26+
pip install --upgrade bumpversion
27+
LAST_TWO_TAGS=$(git for-each-ref refs/tags/ --count=2 --sort=-v:refname --format="%(refname:short)")
28+
LAST_ONE=$(echo $LAST_TWO_TAGS | cut -d' ' -f 2)
29+
last_version=$(echo ${LAST_ONE//v/""})
30+
echo Last version: ${last_version}
31+
new_version=$(echo ${NEW_TAG//v/""})
32+
echo New version: ${new_version}
33+
git config --local user.name "github-actions[bot]"
34+
bumpversion --current-version $last_version --new-version $new_version setup.py
1535
- name: update changelog with gren
1636
env:
1737
GREN_GITHUB_TOKEN: ${{ secrets.TOKEN }}
@@ -85,6 +105,8 @@ jobs:
85105
needs: build
86106
steps:
87107
- uses: actions/checkout@v2
108+
with:
109+
ref: main
88110
- name: Set up Python
89111
uses: actions/setup-python@v2
90112
with:

.reuse/dep5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ License: Apache-2.0
4141
Files: tests/*.txt
4242
Copyright: 2021 LG Electronics
4343
License: Apache-2.0
44+
45+
Files: .bumpversion.cfg
46+
Copyright: 2021 LG Electronics
47+
License: Apache-2.0

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
if __name__ == "__main__":
1515
setup(
1616
name='fosslight_binary',
17-
version='4.0.0',
17+
version='3.5.1',
1818
package_dir={"": "src"},
1919
packages=find_packages(where='src'),
2020
description='FOSSLight Binary Scanner',
2121
long_description=readme,
2222
long_description_content_type='text/markdown',
2323
license='Apache-2.0',
24-
author='Soim Kim',
25-
author_email='[email protected]',
24+
author='LG Electronics',
2625
url='https://github.com/fosslight/fosslight_binary_scanner',
2726
download_url='https://github.com/fosslight/fosslight_binary_scanner',
2827
classifiers=['License :: OSI Approved :: Apache Software License',

0 commit comments

Comments
 (0)