|
| 1 | +name: "Create Release PR" |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + version: |
| 6 | + description: New release version |
| 7 | + type: string |
| 8 | + required: true |
| 9 | + |
| 10 | +jobs: |
| 11 | + create-release-pr: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + token: "${{ secrets.RENKUBOT_GITHUB_TOKEN }}" |
| 18 | + ref: 'develop' |
| 19 | + - uses: actions/setup-node@v3 |
| 20 | + - name: Merge Master |
| 21 | + run: git merge origin/master |
| 22 | + - name: Install dependencies |
| 23 | + run: | |
| 24 | + sudo add-apt-repository -y ppa:rmescandon/yq |
| 25 | + sudo apt-get update -y |
| 26 | + sudo apt-get install -y pandoc yq |
| 27 | + npm install -g conventional-changelog-cli |
| 28 | + - name: Update changelog |
| 29 | + id: changelog |
| 30 | + run: | |
| 31 | + echo '{"version": "${{ github.event.inputs.version }}"}' > context.json |
| 32 | + conventional-changelog -r 1 -p angular -c context.json | pandoc --from markdown --to rst | sed -e '/=======/r /dev/stdin' -e 's/=======/=======\n/' -i CHANGES.rst |
| 33 | + conventional-changelog -r 1 -p angular -c context.json > release_body.md |
| 34 | + rm context.json |
| 35 | + - name: Update version.py |
| 36 | + run: | |
| 37 | + sed -ri 's/__version__ = "[0-9.]+"/__version__ = "${{ github.event.inputs.version }}"/g' renku/version.py |
| 38 | + - name: Update Chart version |
| 39 | + run: | |
| 40 | + yq eval -i '.version = "${{ github.event.inputs.version }}"' helm-chart/renku-core/Chart.yaml |
| 41 | + - name: Update Values file version |
| 42 | + run: | |
| 43 | + yq eval -i '.versions.latest.image.tag = "v${{ github.event.inputs.version }}"' helm-chart/renku-core/values.yaml |
| 44 | + - uses: ncipollo/release-action@v1 |
| 45 | + with: |
| 46 | + token: ${{ secrets.RENKUBOT_GITHUB_TOKEN }} |
| 47 | + draft: true |
| 48 | + bodyFile: "release_body.md" |
| 49 | + tag: "v${{ github.event.inputs.version }}" |
| 50 | + name: "v${{ github.event.inputs.version }}" |
| 51 | + commit: "master" |
| 52 | + - name: Create Pull Request |
| 53 | + uses: peter-evans/create-pull-request@v4 |
| 54 | + with: |
| 55 | + token: "${{ secrets.RENKUBOT_GITHUB_TOKEN }}" |
| 56 | + add-paths: "CHANGES.rst,renku/version.py,helm-chart/renku-core/Chart.yaml,helm-chart/renku-core/values.yaml" |
| 57 | + commit-message: "chore: release v${{ github.event.inputs.version }}" |
| 58 | + branch: "release/v${{ github.event.inputs.version }}" |
| 59 | + base: "master" |
| 60 | + title: "chore: release v${{ github.event.inputs.version }}" |
| 61 | + body: "/deploy" |
0 commit comments