Skip to content

Commit 6db1194

Browse files
committed
ci: fix bumpversion manually
1 parent 0d43ba8 commit 6db1194

File tree

3 files changed

+24
-26
lines changed

3 files changed

+24
-26
lines changed

.bumpversion.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[bumpversion]
2+
current_version = 0.7.2
3+
4+
[bumpversion:file:DESCRIPTION]

.github/version_bump_options.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/auto_semver_bump.yaml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
# also see the options file for configuration
33
name: Manage versions
44

5-
# not actually on all pushes, see the options file
6-
on: [push]
5+
on:
6+
push:
7+
branches: [dev, main]
8+
workflow_dispatch:
79

810
jobs:
911
bump:
@@ -18,8 +20,19 @@ jobs:
1820
- uses: actions/setup-node@v1
1921
with:
2022
node-version: "12"
21-
- name: Bump Versions
22-
uses: michmich112/version-bumper@master
23-
with:
24-
options-file: "./.github/version_bump_options.json"
25-
github-token: ${{ secrets.DMITRY_PAT }}
23+
- name: Change version number
24+
id: version
25+
run: |
26+
python -m pip install bump2version
27+
if [[ "${{ GITHUB_EVENT_NAME }}" == "pull_request"* ]]; then
28+
branch=$(echo "${{ GITHUB_BASE_REF }}")
29+
else
30+
branch=$(echo "${{ GITHUB_REF_NAME }}")
31+
fi
32+
if [[ $branch == "main" ]]; then
33+
version="minor"
34+
else
35+
version="patch"
36+
fi
37+
bump2version $version --commit --message "Bump version: {current_version} → {new_version}" --allow-dirty
38+
git push

0 commit comments

Comments
 (0)