From 38e01ca98c683073882cdd31e470779501d7316a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Lipt=C3=A1k?= Date: Mon, 26 Sep 2022 19:51:52 -0400 Subject: [PATCH] Publish to OSSRH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gábor Lipták --- .github/workflows/ci.yml | 12 ++++++++++-- build.gradle.kts | 12 +++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d50202d87..f4e5ffdde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,14 +153,22 @@ jobs: if: needs.workflow_config.outputs.do_snapshot_release == 'true' env: GITHUB_TOKEN: ${{ github.token }} - run: .github/scripts/release-snapshot.sh + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + run: | + .github/scripts/release-snapshot.sh + gradle publish - name: Create release in GitHub if: needs.workflow_config.outputs.do_release == 'true' env: GITHUB_TOKEN: ${{ github.token }} TAG: ${{ github.event.ref }} - run: .github/scripts/release.sh + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + run: | + .github/scripts/release.sh + gradle publish push_to_registry: needs: [ workflow_config, test, upload ] diff --git a/build.gradle.kts b/build.gradle.kts index 7aa90ec6a..2a0e7261f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -112,16 +112,14 @@ publishing { suppressAllPomMetadataWarnings() } repositories { - maven { - name = "fstest" - url = uri(layout.buildDirectory.dir("repo")) - } maven { name = "OSSRH" - url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" + url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl) credentials { - username = System.getenv("MAVEN_USERNAME") - password = System.getenv("MAVEN_PASSWORD") + username = System.getenv("OSSRH_USERNAME") + password = System.getenv("OSSRH_PASSWORD") } } }