-
Notifications
You must be signed in to change notification settings - Fork 23
51 lines (43 loc) · 1.61 KB
/
bump_version.yml
File metadata and controls
51 lines (43 loc) · 1.61 KB
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
name: Bump version
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
- 'README.md'
- 'CHANGELOG.md'
- 'py/picca/_version.py'
- '.bumpversion.cfg'
jobs:
bump_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_MW_TOKEN_ACTION }}
- name: setup git
run: |
git config --global user.email "Waelthus@users.noreply.github.com"
git config --global user.name "Michael Walther (bot)"
- name: Set up Python
uses: actions/setup-python@v5
- name: Install bump2version
run: pip install bump2version
- name: increase patch
if: ${{ always() && (!contains(github.event.head_commit.message, '[bump major]')) && (!contains(github.event.head_commit.message, '[bump minor]')) && (!contains(github.event.head_commit.message, '[no bump]')) }}
run: bump2version patch --verbose
- name: Bump major version
if: ${{ always() && contains(github.event.head_commit.message, '[bump major]') }}
run: bump2version major --verbose --tag
- name: Bump minor version
if: ${{ always() && contains(github.event.head_commit.message, '[bump minor]') }}
run: bump2version minor --verbose --tag
- name: No version bump
if: ${{ always() && contains(github.event.head_commit.message, '[no bump]') }}
run: echo "No version bump requested"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAT_MW_TOKEN_ACTION }}
tags: true