-
Notifications
You must be signed in to change notification settings - Fork 8
74 lines (62 loc) · 3.21 KB
/
release-pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Create release pull request
on:
workflow_dispatch:
jobs:
create-release-pull-request:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ref: main
persist-credentials: false
# This is needed to get all changes from develop in the PR
# It won't work if we checkout from develop, see https://github.com/peter-evans/create-pull-request/issues/2841
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/examples.md#keep-a-branch-up-to-date-with-another
- name: Fetch develop branch
run: |
git fetch origin develop:develop
git reset --hard develop
- name: Create release draft
uses: release-drafter/release-drafter@v6
id: release-drafter
with:
# release-drafter should be based on develop to get the correct content as pull requests are merged into develop
# Note that the target commitish of the release should be updated to refs/heads/main when published
# (Otherwise the tag will point to the last commit on develop branch instead of the last commit of main branch)
commitish: refs/heads/develop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update CHANGELOG.md
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ steps.release-drafter.outputs.tag_name }}
release-notes: ${{ steps.release-drafter.outputs.body }}
- name: Update files with release version
run: |
./scripts/update-files-with-release-version.sh ${{ steps.release-drafter.outputs.tag_name }}
# If using default Github token, the created pull request won't trigger workflows with pull_request event
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
- name: Generate Github token to create PR
uses: actions/create-github-app-token@v1
id: github-token
with:
app-id: ${{ secrets.ALMA_CREATE_TEAM_PRS_APP_ID }}
private-key: ${{ secrets.ALMA_CREATE_TEAM_PRS_APP_PEM }}
repositories: alma-installments-prestashop
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.github-token.outputs.token }}
commit-message: 'chore: update version'
title: Release ${{ steps.release-drafter.outputs.tag_name }}
body: |
Update version to ${{ steps.release-drafter.outputs.tag_name }}
### Checklist of actions to be done before merging
- [ ] Review and update the CHANGELOG.md if needed
- [ ] Review and update the Github release draft if needed
⚠️ Click on `Save draft` to update it, do not click on `Publish release`: it will be published automatically after the merge of this PR
- [ ] Review and update the translation files after crowdin update if needed
- [ ] Review the files updated with the new version number in the commit named "chore: update version"
branch: release/${{ steps.release-drafter.outputs.tag_name }}
base: main
labels: release