-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (81 loc) · 3.17 KB
/
merge_release.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Merge into upstream branches
on:
release:
types: [ published ]
jobs:
merge_release:
name: Merge into upstream branches
runs-on: ubuntu-latest
steps:
- name: Generate token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.TOKEN_APP_ID }}
private-key: ${{ secrets.TOKEN_APP_SECRET }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Setup git
uses: fregante/setup-git-user@v2
- name: Checkout release branch
run: |
git checkout ${{ github.event.release.target_commitish }}
- name: Reset development version
if: ${{ github.event.release.target_commitish == 'main' }}
run: |
./build reset_development_version
git add VERSION.dev && git commit -m "[Bot] Update development version to $(cat VERSION.dev)." && git push origin main
- name: Merge into feature branch
if: ${{ github.event.release.target_commitish == 'main' }}
run: |
git checkout -b feature origin/feature
git merge origin/main --strategy-option theirs -m "[Bot] Merge branch \"main\" into \"feature\"."
git push origin feature
- name: Merge into bugfix branch
if: ${{ github.event.release.target_commitish == 'main' }} || ${{ github.event.release.target_commitish == 'feature' }}
run: |
git checkout -b bugfix origin/bugfix
git merge origin/feature --strategy-option theirs -m "[Bot] Merge branch \"feature\" into \"bugfix\"."
git push origin bugfix
- name: Update major version
if: ${{ github.event.release.target_commitish == 'main' }}
run: |
git checkout main
./build increment_major_version
git add VERSION
git commit -m "[Bot] Update version to $(cat VERSION)."
git push origin main
git checkout feature
./build increment_minor_version
git add VERSION
git commit -m "[Bot] Update version to $(cat VERSION)."
git push origin feature
git checkout bugfix
./build increment_patch_version
git add VERSION
git commit -m "[Bot] Update version to $(cat VERSION)."
git push origin bugfix
- name: Update minor version
if: ${{ github.event.release.target_commitish == 'feature' }}
run: |
git checkout feature
./build increment_minor_version
git add VERSION
git commit -m "[Bot] Update version to $(cat VERSION)."
git push origin feature
git checkout bugfix
./build increment_patch_version
git add VERSION
git commit -m "[Bot] Update version to $(cat VERSION)."
git push origin bugfix
- name: Update patch version
if: ${{ github.event.release.target_commitish == 'bugfix' }}
run: |
git checkout bugfix
./build increment_patch_version
git add VERSION
git commit -m "[Bot] Update version to $(cat VERSION)."
git push origin bugfix