Skip to content

Commit d1045ba

Browse files
committed
add a new action to update game versions
Optional arg to commit the changes
1 parent dd9522f commit d1045ba

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 'Set Version'
2+
description: 'Updates all references to the current game version'
3+
inputs:
4+
new_release_version:
5+
description: 'The new version string'
6+
required: true
7+
commit_changes:
8+
description: 'Whether to commit the changes or not'
9+
required: false
10+
default: "false"
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Set Constants.h GameVersion
15+
run: sed -i -E '/c_GameVersion = /s/"[^"]*"/"${{inputs.new_release_version}}"/' System/Constants.h
16+
shell: bash
17+
18+
- uses: actions/setup-python@v3
19+
20+
- name: Rewrite meson version
21+
run: |
22+
pip install meson
23+
meson rewrite kwargs set project // version ${{ inputs.new_release_version }}
24+
shell: bash
25+
26+
- name: Commit and push Version Changes
27+
if: ${{ inputs.commit_changes == 'true' }}
28+
shell: bash
29+
run: |
30+
git config --global user.email "[email protected]"
31+
git config --global user.name "GitHub Action"
32+
git add System/GameVersion.h meson.build
33+
git commit -m "Update version" || echo "No changes to commit"
34+
git push
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+

0 commit comments

Comments
 (0)