-
Notifications
You must be signed in to change notification settings - Fork 3.3k
46 lines (40 loc) · 1.42 KB
/
release-v2-cut.yml
File metadata and controls
46 lines (40 loc) · 1.42 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
# Step 1 (v2): Starts the v2 release process by creating a release/v2-candidate branch.
# Generates a changelog PR for review (step 2).
name: "Release v2: Cut"
on:
workflow_dispatch:
inputs:
commit_sha:
description: 'Commit SHA to cut from (leave empty for latest v2)'
required: false
type: string
permissions:
contents: write
actions: write
jobs:
cut-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.commit_sha || 'v2' }}
- name: Check for existing release/v2-candidate branch
env:
GH_TOKEN: ${{ github.token }}
run: |
if git ls-remote --exit-code --heads origin release/v2-candidate &>/dev/null; then
echo "Error: release/v2-candidate branch already exists"
echo "Please finalize or delete the existing release candidate before starting a new one"
exit 1
fi
- name: Create and push release/v2-candidate branch
run: |
git checkout -b release/v2-candidate
git push origin release/v2-candidate
echo "Created branch: release/v2-candidate"
- name: Trigger Release Please
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run release-v2-please.yml --repo ${{ github.repository }} --ref release/v2-candidate
echo "Triggered Release Please workflow for v2"