Skip to content

Commit be2713b

Browse files
committed
Publish and release at the same time
1 parent 1914140 commit be2713b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/ci_test_and_publish.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,27 @@ jobs:
2525
distribution: 'zulu'
2626
java-version: '21'
2727

28-
- name: Upload Artifacts
29-
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
28+
- name: Retrieve version
29+
run: |
30+
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV
31+
- name: Upload Release
32+
run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel
33+
if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
3034
env:
3135
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
3236
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
3337
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
3438
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
3539

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')"
40+
- name: Upload Snapshot
41+
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
42+
if: "endsWith(env.VERSION_NAME, '-SNAPSHOT')"
4243
env:
4344
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
4445
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
46+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
47+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
48+
4549
test:
4650
runs-on: ubuntu-latest
4751
timeout-minutes: 30

0 commit comments

Comments
 (0)