From b35ed76d3c9035752e235f83563716a39411eeda Mon Sep 17 00:00:00 2001 From: Zorbatron Date: Thu, 12 Sep 2024 14:33:20 -0400 Subject: [PATCH] yeah (#28) --- .github/workflows/publish_project.yml | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/publish_project.yml diff --git a/.github/workflows/publish_project.yml b/.github/workflows/publish_project.yml new file mode 100644 index 00000000..48b73e39 --- /dev/null +++ b/.github/workflows/publish_project.yml @@ -0,0 +1,59 @@ +# Copied from GT:CEu +# Publishes the project to GitHub Releases, CurseForge, and Modrinth +name: Publish Project + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' # any SemVer tag, e.g. v1.2.3 + +env: + # link to the changelog with a format code for the version + CHANGELOG_LOCATION: "Changelog is available [here](https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }})" + # type of release + RELEASE_TYPE: 'beta' + +concurrency: + group: publish-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + + permissions: + contents: write # needed to create GitHub releases + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Build + uses: ./.github/actions/build_setup + + - name: Build Project + run: ./gradlew build --warning-mode all --build-cache + + - name: Publish to GitHub + uses: softprops/action-gh-release@v2 + with: + files: "build/libs/*.jar" + generate_release_notes: true + fail_on_unmatched_files: true + + - name: Publish to Curseforge + env: + CURSEFORGE_API_KEY: "${{ secrets.CURSEFORGE_API_KEY }}" + CURSEFORGE_PROJECT_ID: "${{ secrets.CURSEFORGE_PROJECT_ID }}" + CHANGELOG_LOCATION: "${{ env.CHANGELOG_LOCATION }}" + RELEASE_TYPE: "${{ env.RELEASE_TYPE }}" + run: ./gradlew curseforge --warning-mode all --build-cache + + - name: Publish to Modrinth + env: + MODRINTH_API_KEY: "${{ secrets.MODRINTH_API_KEY }}" + MODRINTH_PROJECT_ID: "${{ secrets.MODRINTH_PROJECT_ID }}" + CHANGELOG_LOCATION: "${{ env.CHANGELOG_LOCATION }}" + RELEASE_TYPE: "${{ env.RELEASE_TYPE }}" + run: ./gradlew modrinth --warning-mode all --build-cache \ No newline at end of file