-
Notifications
You must be signed in to change notification settings - Fork 33
45 lines (42 loc) · 1.37 KB
/
bump-to-major-or-minor.yaml
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
name: Bump To Major or Minor
on: [push]
jobs:
bump-to-major-or-minor:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, '[MAJOR]')
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1000
fetch-tags: true
- uses: BrycensRanch/read-properties-action@v1
id: version
with:
file: gradle.properties
property: mod_version
- name: Increment version variable
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ steps.version.outputs.value }}
version-fragment: 'feature'
- name: Replace single file
uses: richardrigutins/replace-in-files@v2
with:
files: 'gradle.properties'
search-text: ${{ steps.version.outputs.value }}
replacement-text: ${{ steps.bump_version.outputs.next-version }}
- name: Append changelog file
uses: DamianReeves/write-file-action@master
with:
path: changelog-1.21.txt
write-mode: append
contents: |
- ${{ github.event.head_commit.message }}
- name: Commit & Push
uses: Andro999b/[email protected]
with:
github_token: ${{ secrets.GIT_TOKEN}}
branch: ${{ github.ref }}
force: true