Skip to content

Commit 41eb65c

Browse files
kariannaCopilot
andauthored
Update release workflow to set gradle.properties version on manual dispatch (#7528)
When the release workflow is triggered manually via workflow_dispatch, the gradle.properties version is now updated to match the entered tag name (with the v prefix stripped). This runs before validation in the create_release job and before the build in the build_release job. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 737ac4a commit 41eb65c

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/gradle-release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ jobs:
2828
with:
2929
ref: ${{ inputs.tag_name || github.ref }}
3030

31+
- name: Update gradle.properties with release version
32+
if: github.event_name == 'workflow_dispatch'
33+
run: |
34+
TAG_NAME="${{ inputs.tag_name }}"
35+
VERSION="${TAG_NAME#v}"
36+
echo "Updating gradle.properties version to ${VERSION}"
37+
sed -i "s/^version=.*/version=${VERSION}/" gradle.properties
38+
echo "Updated gradle.properties:"
39+
grep '^version=' gradle.properties
40+
3141
- name: Validate tag matches gradle.properties version
3242
run: |
3343
TAG_NAME="${{ inputs.tag_name || github.ref_name }}"
@@ -100,6 +110,17 @@ jobs:
100110
with:
101111
ref: ${{ inputs.tag_name || github.ref }}
102112

113+
- name: Update gradle.properties with release version
114+
if: github.event_name == 'workflow_dispatch'
115+
run: |
116+
TAG_NAME="${{ inputs.tag_name }}"
117+
VERSION="${TAG_NAME#v}"
118+
echo "Updating gradle.properties version to ${VERSION}"
119+
sed -i.bak "s/^version=.*/version=${VERSION}/" gradle.properties
120+
rm -f gradle.properties.bak
121+
echo "Updated gradle.properties:"
122+
grep '^version=' gradle.properties
123+
103124
- name: Update PCGenProp.properties with release version and date
104125
run: |
105126
PROPS_FILE="code/src/resources/pcgen/system/prop/PCGenProp.properties"

0 commit comments

Comments
 (0)