Skip to content

Commit 930c5a7

Browse files
committed
ops: Deploy to Sonatype from master only for SNAPSHOT versions
1 parent 508ec28 commit 930c5a7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

.github/workflows/build-gradle-project.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ jobs:
3434
echo "current_version=${version}" >> $GITHUB_ENV
3535
# Only pushes to main and pushed tags trigger a publication to Sonatype OSS
3636
- name: Deploy to Sonatype OSS (maven central)
37-
if: ${{ ((github.ref == 'refs/heads/main') && ("$VERSION" == *SNAPSHOT)) || (startsWith(github.ref, 'refs/tags/')) }}
37+
if: ${{ ((github.ref == 'refs/heads/main') && (endsWith(env.current_version, '-SNAPSHOT'))) || (startsWith(github.ref, 'refs/tags/')) }}
3838
run: gradle publishToSonatype closeAndReleaseSonatypeStagingRepository
3939
env:
40-
VERSION: ${{ env.current_version }}
4140
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
4241
GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
4342
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

0 commit comments

Comments
 (0)