Skip to content

Commit 4456180

Browse files
committed
Add support for publishing snapshot releases
1 parent 78f344e commit 4456180

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

.github/workflows/ci_test_and_publish.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
publish:
1515
runs-on: ubuntu-latest
16-
if: github.repository == 'dropbox/AffectedModuleDetector' && github.ref == 'refs/heads/main'
16+
if: github.repository == 'dropbox/AffectedModuleDetector' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
1717

1818
steps:
1919
- name: Checkout
@@ -25,23 +25,13 @@ jobs:
2525
distribution: 'zulu'
2626
java-version: '17'
2727

28-
- name: Upload Artifacts
29-
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
28+
- name: Publish Artifacts
29+
run: ./gradlew publish --no-daemon --no-parallel
3030
env:
3131
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
3232
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
3333
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
3434
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
35-
36-
- name: Retrieve version
37-
run: |
38-
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV
39-
- name: Publish release
40-
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
41-
if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
42-
env:
43-
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
44-
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
4535
test:
4636
runs-on: ubuntu-latest
4737
timeout-minutes: 30

0 commit comments

Comments
 (0)