|
1 |
| -name: Publish package to the Maven Central Repository |
2 |
| -on: |
3 |
| - release: |
4 |
| - types: |
5 |
| - - published |
6 |
| -jobs: |
7 |
| - publish: |
8 |
| - if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }} |
9 |
| - runs-on: ubuntu-latest |
10 |
| - steps: |
11 |
| - - uses: actions/checkout@v2 |
12 |
| - - name: Set up Apache Maven Central |
13 |
| - uses: actions/setup-java@v2 |
14 |
| - with: |
15 |
| - distribution: 'adopt' |
16 |
| - java-version: '11' |
17 |
| - server-id: ossrh |
18 |
| - server-username: MAVEN_USERNAME |
19 |
| - server-password: MAVEN_CENTRAL_TOKEN |
20 |
| - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} |
21 |
| - gpg-passphrase: MAVEN_GPG_PASSPHRASE |
22 |
| - |
23 |
| - - name: Get Maven project version |
24 |
| - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV |
25 |
| - |
26 |
| - - name: Set Maven project version |
27 |
| - run: mvn versions:set -DnewVersion=$RELEASE_VERSION |
28 |
| - |
29 |
| - - name: Publish to Apache Maven Central |
30 |
| - run: mvn deploy |
31 |
| - env: |
32 |
| - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} |
33 |
| - MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} |
34 |
| - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |
| 1 | +name: Publish package to the Maven Central Repository |
| 2 | +on: |
| 3 | + release: |
| 4 | + types: |
| 5 | + - published |
| 6 | +jobs: |
| 7 | + publish: |
| 8 | + if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }} |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v3 |
| 12 | + - name: Set up Apache Maven Central |
| 13 | + uses: actions/setup-java@v3 |
| 14 | + with: |
| 15 | + distribution: 'adopt' |
| 16 | + java-version: '11' |
| 17 | + server-id: ossrh |
| 18 | + server-username: MAVEN_USERNAME |
| 19 | + server-password: MAVEN_CENTRAL_TOKEN |
| 20 | + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} |
| 21 | + gpg-passphrase: MAVEN_GPG_PASSPHRASE |
| 22 | + |
| 23 | + - name: Get Maven project version |
| 24 | + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV |
| 25 | + |
| 26 | + - name: Set Maven project version |
| 27 | + run: mvn versions:set -DnewVersion=$RELEASE_VERSION |
| 28 | + |
| 29 | + - name: Publish to Apache Maven Central |
| 30 | + run: mvn deploy |
| 31 | + env: |
| 32 | + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} |
| 33 | + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} |
| 34 | + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |
0 commit comments