|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - tags: |
6 | | - - '*' |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +env: |
| 7 | + JAVA_VERSION: 17 |
7 | 8 |
|
8 | 9 | jobs: |
9 | | - build: |
10 | | - name: Build |
11 | | - runs-on: ${{ matrix.os }} |
12 | | - strategy: |
13 | | - matrix: |
14 | | - java_version: [17] |
15 | | - os: [ubuntu-24.04] |
| 10 | + release: |
| 11 | + permissions: |
| 12 | + contents: write |
| 13 | + |
| 14 | + runs-on: ubuntu-24.04 |
16 | 15 |
|
17 | 16 | steps: |
| 17 | + - name: Generate GitHub App(webauthn4j-github-app-bot) Token |
| 18 | + id: app-token |
| 19 | + uses: actions/create-github-app-token@v2 |
| 20 | + with: |
| 21 | + app-id: ${{ secrets.BOT_APP_ID }} |
| 22 | + private-key: ${{ secrets.BOT_PRIVATE_KEY }} |
| 23 | + |
18 | 24 | - name: Checkout |
19 | 25 | uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + token: ${{ steps.app-token.outputs.token }} |
20 | 28 |
|
21 | | - - name: Set up JDK ${{ matrix.java_version }} |
| 29 | + - name: Set up JDK ${{ env.JAVA_VERSION }} |
22 | 30 | uses: actions/setup-java@v4 |
23 | 31 | with: |
24 | 32 | distribution: 'temurin' |
25 | | - java-version: ${{ matrix.java_version }} |
| 33 | + java-version: ${{ env.JAVA_VERSION }} |
26 | 34 | cache: 'gradle' |
27 | 35 |
|
| 36 | + - name: Switch to release |
| 37 | + run: | |
| 38 | + ./gradlew switchToRelease |
| 39 | +
|
| 40 | + - name: Update versions in documents |
| 41 | + run: | |
| 42 | + ./gradlew updateVersionsInDocuments |
| 43 | +
|
28 | 44 | - name: Build with Gradle |
29 | 45 | run: | |
30 | | - ./gradlew build javadoc generateReferenceEN generateReferenceJA -PfailBuildOnCVSS=4 |
| 46 | + ./gradlew build javadoc generateReferenceEN generateReferenceJA |
| 47 | +
|
| 48 | + - name: Commit changes |
| 49 | + shell: bash |
| 50 | + run: | |
| 51 | + VERSION=$(grep "webAuthn4JVersion" gradle.properties | cut -d'=' -f2) |
| 52 | + git config user.name "webauthn4j-bot" |
| 53 | + git config user.email "[email protected]" |
| 54 | + git add . |
| 55 | + git commit --allow-empty -m "Release ${VERSION}" |
| 56 | +
|
| 57 | + - name: Push commit |
| 58 | + shell: bash |
| 59 | + run: | |
| 60 | + git fetch |
| 61 | + git rebase origin/master |
| 62 | + git push |
| 63 | +
|
| 64 | + - name: Tag commit |
| 65 | + shell: bash |
| 66 | + run: | |
| 67 | + VERSION=$(grep "webAuthn4JVersion" gradle.properties | cut -d'=' -f2) |
| 68 | + git tag "${VERSION}.RELEASE" |
| 69 | +
|
| 70 | + - name: Push tag |
| 71 | + shell: bash |
| 72 | + run: | |
| 73 | + VERSION=$(grep "webAuthn4JVersion" gradle.properties | cut -d'=' -f2) |
| 74 | + git fetch |
| 75 | + git rebase origin/master |
| 76 | + git push origin "${VERSION}.RELEASE" |
| 77 | +
|
31 | 78 |
|
32 | 79 | - name: Publish to Maven Central |
33 | 80 | env: |
|
36 | 83 | PGP_SIGNING_KEY: ${{ secrets.PGP_SIGNING_KEY }} |
37 | 84 | PGP_SIGNING_KEY_PASSPHRASE: ${{ secrets.PGP_SIGNING_KEY_PASSPHRASE }} |
38 | 85 | run: | |
39 | | - ./gradlew publishStandardPublicationToMavenCentralRepository |
| 86 | + ./gradlew publishStandardPublicationToLocalStagingRepository jreleaserDeploy |
0 commit comments