-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.35 KB
/
prepare-release.yml
File metadata and controls
49 lines (42 loc) · 1.35 KB
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
name: Prepare Release
on:
workflow_dispatch:
jobs:
create-release-pr:
if: github.repository == 'adyen/adyen-platform-experience-web'
name: Create release PR
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout develop branch (full history)
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
- name: Run the preliminary setup steps
uses: ./.github/actions/setup-env
- name: Fetch main branch
run: git fetch origin main:main
- name: Validate changesets exist
run: |
pnpm changeset status || {
echo "::error::No changesets found. Cannot proceed with release."
exit 1
}
- name: Determine new version
run: |
pnpm changeset status --output=release.json
NEW_VERSION=$(jq -r '.releases[0].newVersion' release.json)
rm release.json
echo "NEW_VERSION=$NEW_VERSION" >> "$GITHUB_ENV"
- name: Create Pull Request
run: |
gh pr create \
--base main \
--head develop \
--title "Start release v${{ env.NEW_VERSION }}" \
--body "Merge develop into main for release v${{ env.NEW_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}