From 741ff534f55659fa075c98b8d517db44f61c6e92 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 11 Jul 2026 15:40:04 -0700 Subject: [PATCH 1/3] Add platform publish workflows (Modrinth, CurseForge) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Publishing a GitHub release previously only fired the Discord webhook because this repo had no release:published workflows. Adds: - modrinth-publish.yml — builds with -Pmaster and uploads the jar to Modrinth (project NnkaZPqQ) - publish.yml — calls the shared BentoBoxWorld/.github reusable workflow to push the release-attached jar to CurseForge (project 1606770); Hangar skipped (addon is not published there) Platform secrets (MODRINTH_TOKEN, CURSEFORGE_TOKEN, HANGAR_API_KEY) are provided at the org level, matching Border/Challenges. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01AgLXH3e951W2wiUg2BU4WM --- .github/workflows/modrinth-publish.yml | 48 ++++++++++++++++++++++++++ .github/workflows/publish.yml | 30 ++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/modrinth-publish.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/modrinth-publish.yml b/.github/workflows/modrinth-publish.yml new file mode 100644 index 0000000..0f3e906 --- /dev/null +++ b/.github/workflows/modrinth-publish.yml @@ -0,0 +1,48 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: adopt + cache: maven + + - name: Build and package with Maven + run: mvn -B clean package -DskipTests -DgenerateBackupPoms=false -Pmaster --file pom.xml + + - name: Upload to Modrinth + uses: cloudnode-pro/modrinth-publish@v2 + with: + token: ${{ secrets.MODRINTH_TOKEN }} + project: NnkaZPqQ + name: ${{ github.event.release.name }} + version: ${{ github.event.release.tag_name }} + changelog: ${{ github.event.release.body }} + loaders: |- + paper + spigot + game-versions: |- + 1.21.5 + 1.21.6 + 1.21.7 + 1.21.8 + 1.21.9 + 1.21.10 + 1.21.11 + 26.1 + 26.1.1 + 26.1.2 + 26.2 + files: ${{ github.workspace }}/target/MagicCobblestoneGenerator-${{ github.event.release.tag_name }}.jar diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ac2a68f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +# MagicCobblestoneGenerator — .github/workflows/publish.yml +# Publishes the jar attached to a GitHub release to CurseForge and Hangar via the +# shared BentoBoxWorld/.github reusable workflow. Downloads the release asset instead of +# rebuilding from source. The reusable workflow is pinned to a commit SHA (Sonar +# githubactions:S7637). workflow_dispatch lets you (re)publish a given version. + +name: Publish release to CurseForge and Hangar + +on: + release: + types: [published] + workflow_dispatch: + inputs: + version: + description: "Version to publish (e.g. 1.2.3)" + required: true + type: string + +jobs: + publish: + uses: bentoboxworld/.github/.github/workflows/publish-platforms.yml@ca2dcd167e8db4e0f671a976080744dda43801a6 # master + with: + use_release_asset: "true" # publish the jar attached to the release; do not rebuild + hangar_slug: "" # blank = skip Hangar (not published there) + curseforge_id: "1606770" + game_versions: "26.2,26.1.2,26.1.1,26.1,1.21.11,1.21.10,1.21.9,1.21.8,1.21.7,1.21.6,1.21.5" + version: ${{ inputs.version }} # empty on release events -> falls back to the release tag + secrets: + HANGAR_API_KEY: ${{ secrets.HANGAR_API_KEY }} + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} From 576a7bd212b8832d5eb04852c8a9d0498eb7b0f4 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 11 Jul 2026 15:44:51 -0700 Subject: [PATCH 2/3] Enable Hangar publishing (slug MagicCobblestoneGenerator) The addon is published on Hangar at tastybento/MagicCobblestoneGenerator, so set hangar_slug rather than skipping it. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01AgLXH3e951W2wiUg2BU4WM --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ac2a68f..082f4ef 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,7 +21,7 @@ jobs: uses: bentoboxworld/.github/.github/workflows/publish-platforms.yml@ca2dcd167e8db4e0f671a976080744dda43801a6 # master with: use_release_asset: "true" # publish the jar attached to the release; do not rebuild - hangar_slug: "" # blank = skip Hangar (not published there) + hangar_slug: "MagicCobblestoneGenerator" # blank = skip Hangar curseforge_id: "1606770" game_versions: "26.2,26.1.2,26.1.1,26.1,1.21.11,1.21.10,1.21.9,1.21.8,1.21.7,1.21.6,1.21.5" version: ${{ inputs.version }} # empty on release events -> falls back to the release tag From 64ea3ef7c516d21d65ed670a47bca4916640f851 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 11 Jul 2026 15:46:55 -0700 Subject: [PATCH 3/3] Pin GitHub Actions to commit SHAs in modrinth-publish (Sonar S7637) Pin actions/checkout, actions/setup-java and cloudnode-pro/modrinth-publish to full-length commit SHAs to satisfy SonarCloud githubactions:S7637, matching the SHAs used across the other BentoBox addons. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01AgLXH3e951W2wiUg2BU4WM --- .github/workflows/modrinth-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/modrinth-publish.yml b/.github/workflows/modrinth-publish.yml index 0f3e906..2d19c97 100644 --- a/.github/workflows/modrinth-publish.yml +++ b/.github/workflows/modrinth-publish.yml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - name: Set up JDK 21 - uses: actions/setup-java@v4 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0 with: java-version: 21 distribution: adopt @@ -23,7 +23,7 @@ jobs: run: mvn -B clean package -DskipTests -DgenerateBackupPoms=false -Pmaster --file pom.xml - name: Upload to Modrinth - uses: cloudnode-pro/modrinth-publish@v2 + uses: cloudnode-pro/modrinth-publish@0be4916ad5f081d936eb5615aa35ce3f0949979c # v2 with: token: ${{ secrets.MODRINTH_TOKEN }} project: NnkaZPqQ