From 90b3b146f0d14df4ee0aa8231cb735f71b673f05 Mon Sep 17 00:00:00 2001 From: Macaron27 Date: Fri, 2 Oct 2026 11:42:16 +0200 Subject: [PATCH] Attach the jars to GitHub releases instead of CI runs - release.yml: publishing a release builds its tag and uploads builds/*.jar to it (refuses a tag that doesn't match the project version). - build.yml: PR and main runs only build and verify; no jar artifacts. - README: point to the releases for downloads. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 5 +---- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ README.md | 3 ++- 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46ff978..e85d707 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,5 @@ jobs: java-version: "25" - uses: gradle/actions/setup-gradle@v6 # Test sources stay local (not in the repository): this compiles everything and checks the shipped jars. + # The jars themselves are attached to GitHub releases (release.yml), not to PR or push runs. - run: ./gradlew build - - uses: actions/upload-artifact@v7 - with: - name: friends-plugins - path: builds/*.jar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5ae3984 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: release + +# Publishing a GitHub release builds its tag and attaches the jars from builds/ to that release. +on: + release: + types: [published] + +permissions: + contents: write # upload release assets + +jobs: + jars: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-java@v6 + with: + distribution: temurin + java-version: "25" + - uses: gradle/actions/setup-gradle@v6 + # A v0.6.0 release must not get 0.5.0 jars: the tag has to match the project version. + - run: 'grep -q "version = \"${TAG#v}\"" build.gradle.kts || { echo "tag $TAG does not match the project version"; exit 1; }' + env: + TAG: ${{ github.event.release.tag_name }} + - run: ./gradlew build + - run: gh release upload "$TAG" builds/*.jar --clobber + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ github.event.release.tag_name }} diff --git a/README.md b/README.md index cde11d9..b973331 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ Modules (one folder per part; a new platform gets its own top-level folder next ./gradlew build # tests, then builds/friends-paper.jar, friends-velocity.jar, friends-bungee.jar, friends-api.jar ``` -Put the jar for your platform in `plugins/`. Every server/proxy must run **Java 25** (Velocity 4.2 and Paper 26.x +Or download the jars from the [GitHub releases](https://github.com/Macaron27/Friends/releases) (each release builds and +attaches them). Put the jar for your platform in `plugins/`. Every server/proxy must run **Java 25** (Velocity 4.2 and Paper 26.x require it anyway; older Paper versions run on it, see below). Add `--enable-native-access=ALL-UNNAMED` to the JVM flags to silence the JDK warning about SQLite's native library.