From 812480903e564c9bdde101145628a77f3c56de0d Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Thu, 20 Jul 2023 12:49:18 -0400 Subject: [PATCH] Fix releasing --- .github/workflows/ci.yml | 2 +- publish.sh | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ce56329..e53e076a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,5 +55,5 @@ jobs: env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} - run: ./publish.sh --snapshot + run: ./publish.sh if: github.ref == 'refs/heads/main' && github.event_name == 'push' diff --git a/publish.sh b/publish.sh index b7036b02..8505d60f 100755 --- a/publish.sh +++ b/publish.sh @@ -1,17 +1,12 @@ #!/bin/bash -if [[ "$1" = "--snapshot" ]]; then snapshot=true; fi if [[ "$1" = "--local" ]]; then local=true; fi if ! [[ ${local} ]]; then - ./gradlew -p moshi-ir/moshi-gradle-plugin publish -x dokkaHtml - if ! [[ ${snapshot} ]]; then - ./gradlew closeAndReleaseRepository - fi + cd moshi-ir/moshi-gradle-plugin publish + ./gradlew publish -x dokkaHtml + cd .. ./gradlew publish -x dokkaHtml - if ! [[ ${snapshot} ]]; then - ./gradlew closeAndReleaseRepository - fi else ./gradlew -p moshi-ir/moshi-gradle-plugin publishToMavenLocal -x dokkaHtml ./gradlew publishToMavenLocal -x dokkaHtml