# Publishes a release to Modrinth and CurseForge when a release is published on GitHub. name: Release Test & Publish on: release: types: [ published ] permissions: contents: read checks: write jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up JDK 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' - name: Build with Gradle uses: gradle/gradle-build-action@v2 with: arguments: build test publish env: RELEASES_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} RELEASES_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - name: Publish Test Report uses: mikepenz/action-junit-report@v3 if: success() || failure() # always run even if the previous step fails with: report_paths: '**/build/test-results/test/TEST-*.xml' - name: Upload to Modrinth & Hangar (Spigot) uses: WiIIiam278/mc-publish@hangar with: modrinth-id: J6U9o3JG modrinth-featured: false modrinth-token: ${{ secrets.MODRINTH_TOKEN }} modrinth-dependencies: | dynmap | suggests | * bluemap | suggests | * pl3xmap | suggests | * plan-player-analytics | suggests | * hangar-id: William278/HuskHomes hangar-token: ${{ secrets.HANGAR_API_KEY }} files-primary: target/HuskHomes-Plugin-*.jar name: HuskHomes (Spigot) v${{ github.event.release.tag_name }} version: ${{ github.event.release.tag_name }} version-type: release changelog: ${{ github.event.release.body }} loaders: | spigot paper purpur folia game-versions: | 1.16.5 1.17.1 1.18.2 1.19.4 1.20 java: 16 - name: Upload to Modrinth (Sponge) uses: WiIIiam278/mc-publish@hangar with: modrinth-id: J6U9o3JG modrinth-featured: false modrinth-token: ${{ secrets.MODRINTH_TOKEN }} modrinth-dependencies: | bluemap | suggests | * plan-player-analytics | suggests | * files-primary: target/HuskHomes-Sponge-*.jar name: HuskHomes (Sponge) v${{ github.event.release.tag_name }} version: ${{ env.version_name }} version-type: release changelog: ${{ github.event.release.body }} loaders: | sponge game-versions: | 1.16.5 1.17.1 1.18.2 1.19.4 1.20 java: 16 - name: Upload to Modrinth & CurseForge (Fabric) uses: WiIIiam278/mc-publish@hangar with: modrinth-id: J6U9o3JG modrinth-featured: false modrinth-token: ${{ secrets.MODRINTH_TOKEN }} curseforge-id: 849217 curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} dependencies: | fabric-api | requires | * dynmap | suggests | * bluemap | suggests | * pl3xmap | suggests | * luckperms | suggests | * plan-player-analytics | suggests | * files-primary: target/HuskHomes-Fabric-*.jar name: HuskHomes (Fabric) v${{ github.event.release.tag_name }} version: ${{ github.event.release.tag_name }} version-type: release changelog: ${{ github.event.release.body }} loaders: | fabric game-versions: | 1.20 java: 17 - name: Upload GitHub Artifact (Spigot) uses: actions/upload-artifact@v2 with: name: HuskHomes (Spigot) path: target/HuskHomes-Plugin-*.jar - name: Upload GitHub Artifact (Sponge) uses: actions/upload-artifact@v2 with: name: HuskHomes (Sponge) path: target/HuskHomes-Sponge-*.jar - name: Upload GitHub Artifact (Fabric) uses: actions/upload-artifact@v2 with: name: HuskHomes (Fabric) path: target/HuskHomes-Fabric-*.jar