-
Notifications
You must be signed in to change notification settings - Fork 72
70 lines (58 loc) · 2.12 KB
/
Copy pathcreate-release-branch.yml
File metadata and controls
70 lines (58 loc) · 2.12 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Create Release Branch
on:
workflow_dispatch:
inputs:
version:
description: "Webiny version (e.g. 6.3.0)"
required: true
type: string
jobs:
create:
name: Create release branch and generate initial changelog
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout master
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Enable Corepack (Yarn Berry)
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Generate branch name
run: echo "BRANCH=release/${{ inputs.version }}-$(cat /dev/urandom | tr -dc 'a-z0-9' | head -c 5)" >> $GITHUB_ENV
- name: Generate changelog
env:
CLAUDE_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: yarn generate:changelog --version ${{ inputs.version }}
- name: Generate upgrade guide
run: yarn generate:upgrade-guide --version ${{ inputs.version }}
- name: Generate announcements
env:
CLAUDE_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: yarn generate:announcements --version ${{ inputs.version }}
- name: Create branch, commit, and push
run: |
git config user.name "webiny-bot"
git config user.email "webiny-bot@webiny.com"
git checkout -b "${{ env.BRANCH }}"
git add .
git commit -m "chore: generate changelog for ${{ inputs.version }}"
git push origin "${{ env.BRANCH }}"
- name: Open pull request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--title "Release ${{ inputs.version }}" \
--base master \
--head "${{ env.BRANCH }}" \
--body "Release branch for Webiny ${{ inputs.version }}. Triggered by the [Full Release](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) workflow."