|
6 | 6 | - 'v[0-9]+.[0-9]+.[0-9]+' |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - release: |
10 | | - name: Publish to Maven Central |
| 9 | + github-release: |
| 10 | + name: Create GitHub Release |
11 | 11 | runs-on: ubuntu-latest |
12 | 12 |
|
13 | 13 | steps: |
14 | 14 | - name: Checkout |
15 | 15 | uses: actions/checkout@v4 |
16 | 16 |
|
17 | | - - name: Set up JDK 17 |
18 | | - uses: actions/setup-java@v4 |
19 | | - with: |
20 | | - java-version: '17' |
21 | | - distribution: 'temurin' |
22 | | - |
23 | | - - name: Set up Gradle |
24 | | - uses: gradle/actions/setup-gradle@v4 |
25 | | - with: |
26 | | - cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} |
27 | | - |
28 | | - - name: Run tests |
29 | | - run: ./gradlew test --stacktrace |
30 | | - |
31 | | - - name: Check public API compatibility |
32 | | - run: ./gradlew apiCheck |
33 | | - |
34 | | - - name: Publish to Maven Central |
35 | | - # --no-configuration-cache: vanniktech publish tasks are not yet |
36 | | - # fully compatible with Gradle configuration cache. |
37 | | - run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache |
38 | | - env: |
39 | | - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} |
40 | | - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} |
41 | | - ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} |
42 | | - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} |
43 | | - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} |
44 | | - |
45 | 17 | - name: Extract version from tag |
46 | 18 | id: version |
47 | 19 | run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT |
|
68 | 40 |
|
69 | 41 | See [CHANGELOG.md](CHANGELOG.md) for what's changed in this release. |
70 | 42 | generate_release_notes: true |
| 43 | + |
| 44 | + publish: |
| 45 | + name: Publish to Maven Central |
| 46 | + runs-on: ubuntu-latest |
| 47 | + needs: github-release |
| 48 | + # Only run when Maven Central secrets are configured |
| 49 | + if: ${{ secrets.MAVEN_CENTRAL_USERNAME != '' }} |
| 50 | + |
| 51 | + steps: |
| 52 | + - name: Checkout |
| 53 | + uses: actions/checkout@v4 |
| 54 | + |
| 55 | + - name: Set up JDK 17 |
| 56 | + uses: actions/setup-java@v4 |
| 57 | + with: |
| 58 | + java-version: '17' |
| 59 | + distribution: 'temurin' |
| 60 | + |
| 61 | + - name: Set up Gradle |
| 62 | + uses: gradle/actions/setup-gradle@v4 |
| 63 | + with: |
| 64 | + cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} |
| 65 | + |
| 66 | + - name: Run tests |
| 67 | + run: ./gradlew test --stacktrace |
| 68 | + |
| 69 | + - name: Check public API compatibility |
| 70 | + run: ./gradlew apiCheck |
| 71 | + |
| 72 | + - name: Publish to Maven Central |
| 73 | + run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache |
| 74 | + env: |
| 75 | + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} |
| 76 | + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} |
| 77 | + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} |
| 78 | + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} |
| 79 | + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} |
0 commit comments