From 66594f06c9d680dc9d03f92894a899c92b3a20ee Mon Sep 17 00:00:00 2001 From: Xitee <59659167+Xitee1@users.noreply.github.com> Date: Sat, 25 Apr 2026 23:52:27 +0200 Subject: [PATCH 1/2] Add CI workflows for build and release - build.yml: builds on push/PR to master, uploads JAR artifact - release.yml: on release-* tags, verifies tag matches pom.xml version, builds, attaches JAR and release notes to GitHub release Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++ .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3162955 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,38 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + cache: maven + + - name: Build with Maven + run: mvn -B --no-transfer-progress package + + - name: Upload JAR + uses: actions/upload-artifact@v4 + with: + name: SMP-jar + path: target/*.jar + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..119abac --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +on: + push: + tags: ['release-*'] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + cache: maven + + - name: Verify tag matches pom.xml version + run: | + POM_VERSION=$(mvn -B -q help:evaluate -Dexpression=project.version -DforceStdout) + TAG_VERSION="${GITHUB_REF_NAME#release-}" + echo "pom.xml version: $POM_VERSION" + echo "Tag version: $TAG_VERSION" + if [ "$POM_VERSION" != "$TAG_VERSION" ]; then + echo "::error::Tag '$GITHUB_REF_NAME' does not match pom.xml version '$POM_VERSION'" + exit 1 + fi + + - name: Build with Maven + run: mvn -B --no-transfer-progress package + + - name: Publish Release + uses: softprops/action-gh-release@v2 + with: + files: target/*.jar + generate_release_notes: true + fail_on_unmatched_files: true From 15d9e0b5bc9bad6b5401b9c2b474a68cd0f8da61 Mon Sep 17 00:00:00 2001 From: Xitee <59659167+Xitee1@users.noreply.github.com> Date: Sun, 26 Apr 2026 19:04:35 +0200 Subject: [PATCH 2/2] Update PaperMC repository URL The legacy papermc.io/repo/repository/maven-public/ host now returns HTTP 403 Forbidden, so Maven cannot resolve paper-api on a clean cache (such as a fresh CI runner) and the build fails. Switch to the current repo.papermc.io/repository/maven-public/ URL, which serves the same artifacts. Co-Authored-By: Claude Opus 4.7 (1M context) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8e30015..94e05d7 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ papermc - https://papermc.io/repo/repository/maven-public/ + https://repo.papermc.io/repository/maven-public/