Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,18 @@ jobs:
- name: Bump version, tag, and push (skipped in dry run)
env:
TAG_NAME: ${{ steps.set_tag.outputs.tag_name }}
DSL_VERSION: ${{ steps.get_dsl_version.outputs.dsl_version }}
DSL_VERSION_OVERRIDE: ${{ github.event.inputs.dsl_version }}
DRY_RUN: ${{ github.event.inputs.dry_run }}
BASE_REF: ${{ github.event.inputs.base_ref || 'main' }}
shell: bash
run: |
set -euo pipefail
if [ "${DRY_RUN}" = "true" ]; then
echo "[DRY RUN] Would set project version to ${TAG_NAME}, commit, tag, and push atomically to ${BASE_REF}."
echo "[DRY RUN] Would tag ${TAG_NAME} and push."
exit 0
fi

# We skip committing changes to the repo. Use versions:set only in the build step ephemerally.
echo "Skipping persistent version bump in pom.xml to avoid branch protection issues."

git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git fetch --prune --tags origin
Expand All @@ -140,8 +139,21 @@ jobs:
exit 1
fi

git tag -a "${TAG_NAME}" -m "Release ${TAG_NAME}"
git push --atomic origin HEAD:"${BASE_REF}" "${TAG_NAME}"
if [ -n "${DSL_VERSION_OVERRIDE}" ]; then
# Update pom.xml so the source at the tag reflects the overridden DSL version.
# Commit stays off main — only the tag is pushed.
mvn -q -B versions:set-property \
-Dproperty=rosetta.dsl.version \
-DnewVersion="${DSL_VERSION}" \
-DgenerateBackupPoms=false
git add pom.xml
git commit -m "chore: set rosetta.dsl.version=${DSL_VERSION} for release ${TAG_NAME}"
git tag -a "${TAG_NAME}" -m "Release ${TAG_NAME}"
git push origin "${TAG_NAME}"
else
git tag -a "${TAG_NAME}" -m "Release ${TAG_NAME}"
git push --atomic origin HEAD:"${BASE_REF}" "${TAG_NAME}"
fi

build-and-verify-release:
needs: prepare-release
Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,17 @@
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifestEntries>
<DSL-Version>${rosetta.dsl.version}</DSL-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down