From df84a9141c7cd9751f5630e3da27ec018cdf0128 Mon Sep 17 00:00:00 2001 From: HellionGames Date: Mon, 4 Apr 2022 18:52:03 -0400 Subject: [PATCH] Added publish workflow --- .github/workflows/publish.yml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1d2214c --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,59 @@ +name: Publish + +on: + push: + tags: + - '*' + +jobs: + publish: + runs-on: ubuntu-20.04 + steps: + + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '17' + cache: 'gradle' + + - name: Build + run: ./gradlew build + + - name: Upload Build Artifact + uses: actions/upload-artifact@v2 + with: + name: build-artifacts + path: build/libs/ + + - name: Publish to Modrinth + run: ./gradlew publishModrinth + env: + MODRINTH: ${{ secrets.MODRINTH_TOKEN }} + + - name: Publish to Curseforge + run: ./gradlew curseforge + env: + CURSEFORGE: ${{ secrets.CURSEFORGE_TOKEN }} + + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + artifacts: "./build/libs/*" + token: ${{ secrets.GITHUB_TOKEN }} + name: Release ${{ steps.get_version.outputs.VERSION }} for Minecraft 1.18.x + + - name: Publish to Infernal Studios Maven + run: ./gradlew publish + env: + MAVEN_USER: ${{ secrets.MAVEN_USER }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} \ No newline at end of file