|
| 1 | +name: Quarkiverse Release |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [closed] |
| 6 | + paths: |
| 7 | + - '.github/project.yml' |
| 8 | + |
| 9 | +jobs: |
| 10 | + release: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + name: release |
| 13 | + if: ${{github.event.pull_request.merged == true}} |
| 14 | + |
| 15 | + steps: |
| 16 | + - uses: radcortez/project-metadata-action@main |
| 17 | + name: Retrieve project metadata |
| 18 | + id: metadata |
| 19 | + with: |
| 20 | + github-token: ${{secrets.GITHUB_TOKEN}} |
| 21 | + metadata-file-path: '.github/project.yml' |
| 22 | + |
| 23 | + - uses: actions/checkout@v3 |
| 24 | + |
| 25 | + - name: Import GPG key |
| 26 | + id: import_gpg |
| 27 | + uses: crazy-max/ghaction-import-gpg@v3 |
| 28 | + with: |
| 29 | + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} |
| 30 | + passphrase: ${{ secrets.GPG_PASSPHRASE }} |
| 31 | + |
| 32 | + - name: Set up JDK 11 |
| 33 | + uses: actions/setup-java@v3 |
| 34 | + with: |
| 35 | + distribution: temurin |
| 36 | + java-version: 11 |
| 37 | + cache: 'maven' |
| 38 | + server-id: ossrh |
| 39 | + server-username: MAVEN_USERNAME |
| 40 | + server-password: MAVEN_PASSWORD |
| 41 | + |
| 42 | + - name: Configure Git author |
| 43 | + run: | |
| 44 | + git config --local user.email "action@github.com" |
| 45 | + git config --local user.name "GitHub Action" |
| 46 | +
|
| 47 | + - name: Maven release ${{steps.metadata.outputs.current-version}} |
| 48 | + run: | |
| 49 | + git checkout -b release |
| 50 | + mvn -B release:prepare -Prelease -DpreparationGoals="clean install" -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} |
| 51 | + if ! git diff --quiet docs/modules/ROOT/pages/includes/attributes.adoc; then |
| 52 | + git add docs/modules/ROOT/pages/includes/attributes.adoc |
| 53 | + git commit -m "Update stable version for documentation" |
| 54 | + fi |
| 55 | + git checkout ${{github.base_ref}} |
| 56 | + git rebase release |
| 57 | + mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease |
| 58 | + env: |
| 59 | + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} |
| 60 | + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} |
| 61 | + |
| 62 | + - name: Adjust tag for documentation changes |
| 63 | + run: | |
| 64 | + git checkout ${{steps.metadata.outputs.current-version}} |
| 65 | + mvn -B clean install -DskipTests -DskipITs |
| 66 | + if ! git diff --quiet docs/modules/ROOT/pages/includes/attributes.adoc; then |
| 67 | + git add docs/modules/ROOT/pages/includes/attributes.adoc |
| 68 | + git commit -m "Update stable version for documentation" |
| 69 | + # Move the tag after inclusion of documentation adjustments |
| 70 | + git tag -f ${{steps.metadata.outputs.current-version}} |
| 71 | + fi |
| 72 | + # Go back to base branch |
| 73 | + git checkout ${{github.base_ref}} |
| 74 | +
|
| 75 | + - name: Push changes to ${{github.base_ref}} |
| 76 | + uses: ad-m/github-push-action@v0.6.0 |
| 77 | + with: |
| 78 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 79 | + branch: ${{github.base_ref}} |
| 80 | + |
| 81 | + - name: Push tags |
| 82 | + uses: ad-m/github-push-action@v0.6.0 |
| 83 | + with: |
| 84 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + tags: true |
| 86 | + branch: ${{github.base_ref}} |
0 commit comments