-
Notifications
You must be signed in to change notification settings - Fork 28
59 lines (53 loc) · 1.92 KB
/
bump_version.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
on:
push:
branches: [ master, dev]
jobs:
version-bump:
runs-on: ubuntu-latest
if: ${{ !contains(github.actor, '[bot]') }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4.1.0
with:
python-version: 3.10.9
architecture: x64
- name: Install bump2version
run: pip install bump2version
- name: Determine Version Increment
id: bump
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
git config --global user.email "bump2version@dk64randomizer.com"
git config --global user.name "Bump2Version"
git config --unset-all http.https://github.com/.extraheader
echo "Branch: $BRANCH_NAME, Commit Message: $COMMIT_MESSAGE"
if [[ "$BRANCH_NAME" == "dev" ]]; then
if [[ "$COMMIT_MESSAGE" == *"Major Release"* ]]; then
echo "Bumping major version"
echo "VERSION_PART=major" >> $GITHUB_OUTPUT
elif [[ "$COMMIT_MESSAGE" == *"Breaks older cosmetics packs"* ]]; then
echo "Bumping minor version"
echo "VERSION_PART=minor" >> $GITHUB_OUTPUT
else
echo "Bumping patch version"
echo "VERSION_PART=patch" >> $GITHUB_OUTPUT
fi
fi
- name: Bump Version
run: bump2version ${{ steps.bump.outputs.VERSION_PART }}
- id: create_token
uses: tibdex/github-app-token@v1
with:
app_id: 715479
installation_id: 45211287
private_key: ${{ secrets.BRANCHPROTECTION }}
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ steps.create_token.outputs.token }}
branch: ${{ github.ref }}