Skip to content

Commit

Permalink
Fix releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Jul 20, 2023
1 parent 8bc4b08 commit 8124809
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
11 changes: 3 additions & 8 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 8124809

Please sign in to comment.