Skip to content

Commit

Permalink
Maven publication: couple closeSonatypeStagingRepository to publicati…
Browse files Browse the repository at this point in the history
…on task on release
  • Loading branch information
DariusIMP committed Jan 21, 2025
1 parent ab482d9 commit 0fbd4e0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/publish-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,13 @@ jobs:
- if: ${{ inputs.maven_publish == true }}
name: Gradle Publish Android Package to Maven Central repository
run: |
./gradlew publishAndroidReleasePublicationToSonatypeRepository -PremotePublication=true -Pandroid=true ${{ env.PUB_MODE }}
env:
ORG_OSSRH_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }}
ORG_OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
ORG_GPG_KEY_ID: ${{ secrets.ORG_GPG_KEY_ID }}
ORG_GPG_SUBKEY_ID: ${{ secrets.ORG_GPG_SUBKEY_ID }}
ORG_GPG_PRIVATE_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
ORG_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}

- if: ${{ inputs.maven_publish == true && inputs.snapshot == false }}
name: Close & Release Staging Repository
run: ./gradlew closeAndReleaseSonatypeStagingRepository -Pandroid=true
if [[ "${{ inputs.snapshot }}" == "true" ]]; then
./gradlew publishAndroidReleasePublicationToSonatypeRepository -PremotePublication=true -Pandroid=true ${{ env.PUB_MODE }}
else
./gradlew publishAndroidReleasePublicationToSonatypeRepository \
closeAndReleaseSonatypeStagingRepository \
-PremotePublication=true -Pandroid=true ${{ env.PUB_MODE }}
fi
env:
ORG_OSSRH_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }}
ORG_OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/publish-jvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,13 @@ jobs:
- if: ${{ inputs.maven_publish == true }}
name: Gradle Publish JVM Package to Maven Central repository
run: |
./gradlew publishJvmPublicationToSonatypeRepository -PremotePublication=true ${{ env.PUB_MODE }}
env:
ORG_OSSRH_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }}
ORG_OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
ORG_GPG_KEY_ID: ${{ secrets.ORG_GPG_KEY_ID }}
ORG_GPG_SUBKEY_ID: ${{ secrets.ORG_GPG_SUBKEY_ID }}
ORG_GPG_PRIVATE_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
ORG_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}

- if: ${{ inputs.maven_publish == true && inputs.snapshot == false }}
name: Close & Release Staging Repository
run: ./gradlew closeAndReleaseSonatypeStagingRepository
if [[ "${{ inputs.snapshot }}" == "true" ]]; then
./gradlew publishJvmPublicationToSonatypeRepository -PremotePublication=true ${{ env.PUB_MODE }}
else
./gradlew publishJvmPublicationToSonatypeRepository \
closeAndReleaseSonatypeStagingRepository \
-PremotePublication=true ${{ env.PUB_MODE }}
fi
env:
ORG_OSSRH_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }}
ORG_OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
Expand Down

0 comments on commit 0fbd4e0

Please sign in to comment.