Skip to content

Commit 5fc23a7

Browse files
Update the release workflow to ensure that the POM bundled in the soruce code release includes the DSL version override
1 parent 0ff5641 commit 5fc23a7

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,18 @@ jobs:
119119
- name: Bump version, tag, and push (skipped in dry run)
120120
env:
121121
TAG_NAME: ${{ steps.set_tag.outputs.tag_name }}
122+
DSL_VERSION: ${{ steps.get_dsl_version.outputs.dsl_version }}
123+
DSL_VERSION_OVERRIDE: ${{ github.event.inputs.dsl_version }}
122124
DRY_RUN: ${{ github.event.inputs.dry_run }}
123125
BASE_REF: ${{ github.event.inputs.base_ref || 'main' }}
124126
shell: bash
125127
run: |
126128
set -euo pipefail
127129
if [ "${DRY_RUN}" = "true" ]; then
128-
echo "[DRY RUN] Would set project version to ${TAG_NAME}, commit, tag, and push atomically to ${BASE_REF}."
130+
echo "[DRY RUN] Would tag ${TAG_NAME} and push."
129131
exit 0
130132
fi
131133
132-
# We skip committing changes to the repo. Use versions:set only in the build step ephemerally.
133-
echo "Skipping persistent version bump in pom.xml to avoid branch protection issues."
134-
135134
git config --global user.email "github-actions[bot]@users.noreply.github.com"
136135
git config --global user.name "github-actions[bot]"
137136
git fetch --prune --tags origin
@@ -140,8 +139,21 @@ jobs:
140139
exit 1
141140
fi
142141
143-
git tag -a "${TAG_NAME}" -m "Release ${TAG_NAME}"
144-
git push --atomic origin HEAD:"${BASE_REF}" "${TAG_NAME}"
142+
if [ -n "${DSL_VERSION_OVERRIDE}" ]; then
143+
# Update pom.xml so the source at the tag reflects the overridden DSL version.
144+
# Commit stays off main — only the tag is pushed.
145+
mvn -q -B versions:set-property \
146+
-Dproperty=rosetta.dsl.version \
147+
-DnewVersion="${DSL_VERSION}" \
148+
-DgenerateBackupPoms=false
149+
git add pom.xml
150+
git commit -m "chore: set rosetta.dsl.version=${DSL_VERSION} for release ${TAG_NAME}"
151+
git tag -a "${TAG_NAME}" -m "Release ${TAG_NAME}"
152+
git push origin "${TAG_NAME}"
153+
else
154+
git tag -a "${TAG_NAME}" -m "Release ${TAG_NAME}"
155+
git push --atomic origin HEAD:"${BASE_REF}" "${TAG_NAME}"
156+
fi
145157
146158
build-and-verify-release:
147159
needs: prepare-release

0 commit comments

Comments
 (0)