From c730272b718f91f7a9db4ec8aa1ed7cad96f1c87 Mon Sep 17 00:00:00 2001 From: Mqx <62719703+Mqxx@users.noreply.github.com> Date: Sun, 5 Apr 2026 18:03:47 +0200 Subject: [PATCH] feat: Publish Workflow --- .github/workflows/build.yml | 2 +- .github/workflows/publish.yml | 37 ++++++++++++++++++++++++++++++ src/main/resources/fabric.mod.json | 10 ++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0f241e..1ca2fdd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: ./gradlew build --scan ls -la build/libs/ - - name: 'Save Artifact' + - name: 'Upload Artifact' uses: actions/upload-artifact@v4 id: save-artifact with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..119258d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +name: 'Publish Datapack' + +env: + ARTIFACT_NAME: 'msmp_console' + +on: + release: + types: [published] + +jobs: + build: + name: 'Build' + uses: ./.github/workflows/build.yml + + publish: + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@v4 + + - name: 'Download Artifact' + uses: actions/download-artifact@v4 + with: + path: './artifacts' + name: '${{ env.ARTIFACT_NAME }}' + + - name: 'Publish to Modrinth' + uses: Kir-Antipov/mc-publish@v3.3 + with: + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + files: | + ./artifacts/*.jar + + name: ${{ github.event.repository.name }} + version: ${{ github.event.release.tag_name }} + version-type: ${{ github.event.release.prerelease && 'beta' || 'release' }} + changelog: ${{ github.event.release.body }} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 46c332e..94e9e1b 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -28,5 +28,15 @@ "fabricloader": ">=${loader_version}", "fabric-api": "*", "minecraft": "${minecraft_version}" + }, + "custom": { + "mc-publish": { + "modrinth": { + "project_id": "kVuh4pG0", + "loaders": [ + "fabric" + ] + } + } } }