-
Notifications
You must be signed in to change notification settings - Fork 174
59 lines (47 loc) · 1.77 KB
/
bump-version-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Bump Version (dev)
on:
push:
branches:
- dev
jobs:
build:
if: (! contains(github.event.head_commit.message, '[no bump]'))
name: Bump version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Set env variables
run: |
# The next line is very important, otherwise the line after triggers
# git to track the permission change, which breaks bump2version API (needs clean git folder)
git config core.filemode false
chmod +x .github/workflows/utils.sh
echo "VERSION_FILE=openpnm/__version__.py" >> $GITHUB_ENV
echo "SETUP_CFG_FILE=setup.cfg" >> $GITHUB_ENV
echo "${{ github.event.head_commit.message }}"
- name: Install dependencies
run: |
pip install bump2version
- name: Bump version (build)
run: |
source .github/workflows/utils.sh
bump_version build $VERSION_FILE
# Note that we don't want to create a new tag for "builds"
# - name: Commit files
# run: |
# REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
# remote_repo="https://${GITHUB_ACTOR}:${{ secrets.PUSH_ACTION_TOKEN }}@github.com/${REPOSITORY}.git"
# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Action"
# # Commit version bump to dev ([no ci] to avoid infinite loop)
# git commit -m "Bump version number (build) [no ci]" -a
# git push "${remote_repo}" dev
- name: Commit files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Bump version number (build part)
commit_author: Author <actions@github.com>