From 97c594f2e55aca96f78deb21ef25a70a5a3341a1 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Sat, 10 Feb 2024 00:36:24 +0000 Subject: [PATCH] Publish to my maven after release build is successful. --- .github/workflows/release.yml | 11 +++++++++-- build.gradle | 13 ++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3573ace59..eb8caf923f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,8 +49,6 @@ jobs: with: arguments: publishMod - # TODO: Publish to maven. - - name: Upload to GitHub Releases uses: softprops/action-gh-release@v1 with: @@ -89,6 +87,15 @@ jobs: embed-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} embed-color: 15548997 + # Publish to Rover's maven last. Failure email will still be sent, but it'll still release elsewhere + - name: Rover656 Maven Publish + uses: gradle/gradle-build-action@v2 + env: + RVR_MAVEN_USER: ${{ secrets.RVR_MAVEN_USER }} + RVR_MAVEN_PASSWORD: ${{ secrets.RVR_MAVEN_PASSWORD }} + with: + arguments: publishAllPublicationsToRover656Repository + updateReleaseBranch: needs: [release] runs-on: ubuntu-latest diff --git a/build.gradle b/build.gradle index 6d197c9501..1bd1aa6cb1 100644 --- a/build.gradle +++ b/build.gradle @@ -412,8 +412,19 @@ publishing { } } } + } - // TODO: Repositories to publish to... + repositories { + if (System.getenv("RVR_MAVEN_USER") != null) { + maven { + name = "Rover656" + url = "https://maven.rover656.dev/releases" + credentials { + username = System.getenv("RVR_MAVEN_USER") + password = System.getenv("RVR_MAVEN_PASSWORD") + } + } + } } }