Make mod_version the source of truth for releases; bump to 0.1.1-beta
The release workflow no longer overrides mod_version from the tag. Instead it fails early unless the release tag (optionally prefixed with "v") matches mod_version in gradle.properties, so released jars always report the same version as the code the version check sees. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
# Publishing a release builds every Minecraft version from the release's tag
|
# Publishing a release builds every Minecraft version and attaches the mod jars
|
||||||
# and attaches the mod jars to it. The tag is the mod version (e.g.
|
# to it. mod_version in gradle.properties is the source of truth: the release
|
||||||
# 0.1.1-beta); a leading "v" is dropped.
|
# tag must match it (a leading "v" is allowed), so bump mod_version in a PR
|
||||||
|
# before tagging the release.
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
@@ -19,6 +20,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
|
- name: Check tag matches mod_version
|
||||||
|
env:
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: |
|
||||||
|
MOD_VERSION="$(sed -n 's/^mod_version=//p' gradle.properties | tr -d '[:space:]')"
|
||||||
|
if [ "${TAG#v}" != "$MOD_VERSION" ]; then
|
||||||
|
echo "::error::Release tag '$TAG' doesn't match mod_version '$MOD_VERSION' in gradle.properties. Bump mod_version to '${TAG#v}' on the release branch, or tag the release '$MOD_VERSION'." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Building Saturn Client $MOD_VERSION"
|
||||||
|
|
||||||
- name: Set up Java 21
|
- name: Set up Java 21
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
@@ -27,14 +39,10 @@ jobs:
|
|||||||
cache: gradle
|
cache: gradle
|
||||||
|
|
||||||
- name: Build all versions
|
- name: Build all versions
|
||||||
env:
|
|
||||||
TAG: ${{ github.event.release.tag_name }}
|
|
||||||
run: |
|
run: |
|
||||||
VERSION="${TAG#v}"
|
|
||||||
echo "Building Saturn Client $VERSION"
|
|
||||||
chmod +x gradlew
|
chmod +x gradlew
|
||||||
# buildAll remaps every versions/* project in parallel into build/allJars.
|
# buildAll remaps every versions/* project in parallel into build/allJars.
|
||||||
./gradlew buildAll -Pmod_version="$VERSION" --no-daemon --stacktrace
|
./gradlew buildAll --no-daemon --stacktrace
|
||||||
|
|
||||||
- name: Upload jars to the release
|
- name: Upload jars to the release
|
||||||
env:
|
env:
|
||||||
|
|||||||
+1
-1
@@ -4,4 +4,4 @@ org.gradle.parallel=true
|
|||||||
# IntelliJ IDEA is not yet fully compatible with configuration cache, see: https://github.com/FabricMC/fabric-loom/issues/1349
|
# IntelliJ IDEA is not yet fully compatible with configuration cache, see: https://github.com/FabricMC/fabric-loom/issues/1349
|
||||||
org.gradle.configuration-cache=false
|
org.gradle.configuration-cache=false
|
||||||
|
|
||||||
mod_version=0.1.0-beta3
|
mod_version=0.1.1-beta
|
||||||
|
|||||||
Reference in New Issue
Block a user