|
| 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@master |
| 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@v2 |
| 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 | + - uses: actions/setup-java@v1.4.3 |
| 33 | + with: |
| 34 | + java-version: 11 |
| 35 | + |
| 36 | + - name: Cache local Maven repository |
| 37 | + uses: actions/cache@v2 |
| 38 | + with: |
| 39 | + path: ~/.m2/repository |
| 40 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 41 | + restore-keys: | |
| 42 | + ${{ runner.os }}-maven- |
| 43 | +
|
| 44 | + - name: Configure Git author |
| 45 | + run: | |
| 46 | + git config --local user.email "action@github.com" |
| 47 | + git config --local user.name "GitHub Action" |
| 48 | +
|
| 49 | + - name: Maven release ${{steps.metadata.outputs.current-version}} |
| 50 | + run: | |
| 51 | + gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.GPG_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg |
| 52 | + git checkout -b release |
| 53 | + mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} -s maven-settings.xml |
| 54 | + git checkout ${{github.base_ref}} |
| 55 | + git rebase release |
| 56 | + mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease -s maven-settings.xml |
| 57 | +
|
| 58 | + - name: Push changes to ${{github.base_ref}} |
| 59 | + uses: ad-m/github-push-action@v0.6.0 |
| 60 | + with: |
| 61 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + branch: ${{github.base_ref}} |
| 63 | + |
| 64 | + - name: Push tags |
| 65 | + uses: ad-m/github-push-action@v0.6.0 |
| 66 | + with: |
| 67 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 68 | + tags: true |
0 commit comments