Skip to content

Commit

Permalink
Fix workflow to only close and release non-snapshot versions
Browse files Browse the repository at this point in the history
  • Loading branch information
xxfast authored Apr 20, 2022
1 parent 09dc340 commit 2e1caad
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,24 @@ jobs:
debugdrawer-retrofit/build/outputs/aar/debugdrawer-retrofit-release.aar
debugdrawer-timber/build/outputs/aar/debugdrawer-timber-release.aar
- name: Release to sonatype
- name: Publish to sonatype
if: ${{ github.event_name != 'pull_request' }}
run: |
echo signingInMemoryKeyPassword="${GPG_PASSWORD}" >> "$HOME/.gradle/gradle.properties"
echo signingInMemoryKey="${GPG_KEY}" >> "$HOME/.gradle/gradle.properties"
echo mavenCentralUsername="${MAVEN_CENTRAL_USERNAME}" >> "$HOME/.gradle/gradle.properties"
echo mavenCentralPassword="${MAVEN_CENTRAL_PASSWORD}" >> "$HOME/.gradle/gradle.properties"
./gradlew androidSourcesJar androidJavadocJar publish closeAndReleaseRepository --info --no-daemon --no-parallel
./gradlew androidSourcesJar androidJavadocJar publish --info --no-daemon --no-parallel
env:
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_KEY: ${{ secrets.GPG_KEY }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

- name: Close and release repository
if: ${{ github.event_name != 'pull_request' && env.IS_SNAPSHOT == 'false' }}
run: |
./gradlew closeAndReleaseRepository --info --no-daemon --no-parallel
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

0 comments on commit 2e1caad

Please sign in to comment.