Skip to content

Commit f4aefe9

Browse files
authored
Merge pull request #407 from cmu-delphi/ds/ci
ci: fix bumpversion manually
2 parents 0d43ba8 + 2c0eb6c commit f4aefe9

File tree

3 files changed

+27
-28
lines changed

3 files changed

+27
-28
lines changed

.bumpversion.cfg

+4
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

-19
This file was deleted.

.github/workflows/auto_semver_bump.yaml

+23-9
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:
@@ -15,11 +17,23 @@ jobs:
1517
- uses: actions/[email protected]
1618
with:
1719
token: ${{ secrets.DMITRY_PAT }}
18-
- uses: actions/setup-node@v1
20+
- name: Set up Python 3.8
21+
uses: actions/setup-python@v2
1922
with:
20-
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+
python-version: 3.8
24+
- name: Change version number
25+
id: version
26+
run: |
27+
python -m pip install bump2version
28+
if [[ "${{ GITHUB_EVENT_NAME }}" == "pull_request"* ]]; then
29+
branch=$(echo "${{ GITHUB_BASE_REF }}")
30+
else
31+
branch=$(echo "${{ GITHUB_REF_NAME }}")
32+
fi
33+
if [[ $branch == "main" ]]; then
34+
version="minor"
35+
else
36+
version="patch"
37+
fi
38+
bump2version $version --commit --message "Bump version: {current_version} → {new_version}" --allow-dirty
39+
git push

0 commit comments

Comments
 (0)