-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.74 KB
/
Copy pathbump_version.yml
File metadata and controls
50 lines (39 loc) · 1.74 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
name: Bump Version
on:
pull_request:
types: [closed]
jobs:
bump_version:
if: ${{ github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_IPR_TOKEN_ACTION }}
- name: Setup git
run: |
git config --global user.email "iprafols@users.noreply.github.com"
git config --global user.name "Ignasi Pérez-Ràfols (bot)"
- name: Set up Python
uses: actions/setup-python@v4
- name: Install bump2version
run: pip install bump2version
- name: Increase patch
if: ${{ always() && !contains(github.event.pull_request.labels.*.name, '[bump major]') && !contains(github.event.pull_request.labels.*.name, '[bump minor]') && !contains(github.event.pull_request.labels.*.name, '[no bump]') }}
run: bump2version patch --verbose
- name: Bump major version
if: ${{ always() && contains(github.event.pull_request.labels.*.name, '[bump major]') }}
run: bump2version major --verbose --tag
- name: Bump minor version
if: ${{ always() && contains(github.event.pull_request.labels.*.name, '[bump minor]') }}
run: bump2version minor --verbose --tag
- name: No version bump
if: ${{ always() && contains(github.event.pull_request.labels.*.name, '[no bump]') }}
run: echo "No version bump requested"
- name: Push changes
if: ${{ always() && !contains(github.event.pull_request.labels.*.name, '[no bump]') }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAT_IPR_TOKEN_ACTION }}
tags: true
commit_message: "Bump version: {current_version} → {new_version} [skip ci]"