Skip to content

Commit 542c520

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ 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:
4040
VERSION: ${{ env.current_version }}

0 commit comments

Comments
 (0)