-
Notifications
You must be signed in to change notification settings - Fork 33
36 lines (35 loc) · 1.14 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
name: Bump To Major or Minor
on: [push]
jobs:
bump-to-major-or-minor:
runs-on: ubuntu-latest
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
if: contains(github.event.head_commit.message, '[MAJOR_BUMP]')
uses: christian-draeger/increment-semantic-version@1.2.3
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: Commit & Push
uses: Andro999b/push@v1.3
with:
github_token: ${{ secrets.GIT_TOKEN}}
branch: ${{ github.ref }}
force: true