|
| 1 | +name: Release request |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - develop |
| 8 | + |
| 9 | +jobs: |
| 10 | + release: |
| 11 | + permissions: |
| 12 | + contents: write |
| 13 | + pull-requests: write |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v3 |
| 17 | + with: |
| 18 | + ref: main |
| 19 | + - name: Reset promotion branch |
| 20 | + run: | |
| 21 | + git fetch origin develop:develop |
| 22 | + git reset --hard develop |
| 23 | + - name: Get the release script |
| 24 | + run: | |
| 25 | + wget https://raw.githubusercontent.com/Adyen/adyen-node-api-library/develop/.github/scripts/release.js -P ./.github/scripts |
| 26 | + - name: Prepare release request |
| 27 | + uses: actions/github-script@v6 |
| 28 | + id: release |
| 29 | + with: |
| 30 | + script: | |
| 31 | + const helper = require('./.github/scripts/helper.js') |
| 32 | + const release = require('./.github/scripts/release.js') |
| 33 | + const options = { github, context, core, getCurrentVersion: helper.pomJavaVersion }; |
| 34 | + await release.bump(options); |
| 35 | + - name: Bump version |
| 36 | + uses: actions/github-script@v6 |
| 37 | + with: |
| 38 | + script: | |
| 39 | + const helper = require('./.github/scripts/helper.js') |
| 40 | + await helper.updateJavaVersion("${{steps.release.outputs.nextVersion}}"); |
| 41 | + - name: Delete the release script |
| 42 | + run: | |
| 43 | + rm -f ./.github/scripts/release.js |
| 44 | + - name: Create Pull Request |
| 45 | + id: cpr |
| 46 | + uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v5.0.1 |
| 47 | + with: |
| 48 | + token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} |
| 49 | + committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }} |
| 50 | + author: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }} |
| 51 | + branch: automation/release |
| 52 | + title: Release v${{steps.release.outputs.nextVersion}} |
| 53 | + body: | |
| 54 | + Merged pull requests to be released: |
| 55 | + ${{steps.release.outputs.changelog}} |
| 56 | + commit-message: "chore(release): bump to ${{steps.release.outputs.nextVersion}}" |
| 57 | + delete-branch: true |
| 58 | + - name: Enable Pull Request Automerge |
| 59 | + if: steps.cpr.outputs.pull-request-operation == 'created' |
| 60 | + uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0 |
| 61 | + with: |
| 62 | + token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} |
| 63 | + pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} |
| 64 | + merge-method: merge |
0 commit comments