From 9c5f026c849c95cc77d4d17adc9627bf99603287 Mon Sep 17 00:00:00 2001
From: Ryan Barlow <7389646+ryanbarlow97@users.noreply.github.com>
Date: Tue, 22 Sep 2026 23:28:26 +0000
Subject: [PATCH] fix(ci): derive plugin release versions from tags
---
.github/workflows/build.yml | 10 +++++++---
.github/workflows/maven-release.yml | 11 +++--------
pom.xml | 2 +-
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 451834f..61c6ece 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,11 +25,14 @@ jobs:
env:
GH_TOKEN: ${{ secrets.DEPS_TOKEN }}
run: bash .github/scripts/prepare-release.sh
- - name: Set dated development version
+ - name: Set build version
id: dev
shell: bash
run: |
- dev_version="DEV-$(date -u +%Y%m%d-%H%M)"
+ dev_version="main-SNAPSHOT"
+ if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
+ dev_version="DEV-$(date -u +%Y%m%d-%H%M)"
+ fi
mvn -B --no-transfer-progress -P'!deploy-live' org.codehaus.mojo:versions-maven-plugin:2.22.0:set \
-DnewVersion="$dev_version" -DgenerateBackupPoms=false
mvn -B --no-transfer-progress -P'!deploy-live' help:evaluate \
@@ -49,7 +52,8 @@ jobs:
BUILD_VERSION: ${{ steps.dev.outputs.version }}
run: python3 .github/scripts/plugin-artifact.py --jar "$ARTIFACT_PATH" --version "$BUILD_VERSION"
- - uses: actions/upload-artifact@v7
+ - if: github.event_name == 'pull_request'
+ uses: actions/upload-artifact@v7
with:
name: ${{ steps.dev.outputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ steps.dev.outputs.jar }}
diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml
index 1659a9b..91913f5 100644
--- a/.github/workflows/maven-release.yml
+++ b/.github/workflows/maven-release.yml
@@ -54,18 +54,13 @@ jobs:
bash .github/scripts/prepare-release.sh
fi
- - name: Check Maven version and build
+ - name: Set version from tag and build
id: maven
env:
TAG: ${{ github.ref_name }}
run: |
- version_file="$RUNNER_TEMP/maven-release-version"
- mvn -B --no-transfer-progress -P'!deploy-live' help:evaluate \
- -Dexpression=project.version -Doutput="$version_file"
- [[ "$(cat "$version_file")" == "${TAG#v}" ]] || {
- echo '::error::The tag must match project.version exactly.'
- exit 1
- }
+ mvn -B --no-transfer-progress -P'!deploy-live' org.codehaus.mojo:versions-maven-plugin:2.22.0:set \
+ -DnewVersion="${TAG#v}" -DgenerateBackupPoms=false
mvn -B --no-transfer-progress -P'!deploy-live' help:evaluate \
-Dexpression=project.build.finalName -Doutput="$RUNNER_TEMP/final-name"
final_name=$(cat "$RUNNER_TEMP/final-name")
diff --git a/pom.xml b/pom.xml
index 6190e2f..fffd6bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
net.tfminecraft
worldborder
- 0.1.0
+ main-SNAPSHOT
21