-
Notifications
You must be signed in to change notification settings - Fork 853
120 lines (106 loc) · 4.26 KB
/
Copy pathcreate-rc.yml
File metadata and controls
120 lines (106 loc) · 4.26 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Create RC on Release Branch
on:
workflow_dispatch:
inputs:
release_branch:
description: 'Release branch (e.g., release/v1.3)'
required: true
type: string
dry_run:
description: 'Dry run (simulate without pushing)'
required: true
default: false
type: boolean
permissions:
contents: read
jobs:
create-rc:
runs-on: ubuntu-latest
outputs:
rc_version: ${{ steps.create.outputs.RC_VERSION }}
rc_tag: ${{ steps.create.outputs.RC_TAG }}
steps:
- name: Output Inputs
run: echo "${{ toJSON(github.event.inputs) }}"
- name: Check out repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
token: ${{ secrets.LANCE_RELEASE_TOKEN }}
fetch-depth: 0
lfs: true
- name: Setup release environment
uses: ./.github/actions/setup-release-env
- name: Create RC
id: create
run: |
bash ci/create_rc.sh "${{ inputs.release_branch }}"
- name: Create GitHub Discussion for voting
if: ${{ !inputs.dry_run }}
id: create_discussion
env:
GH_TOKEN: ${{ secrets.LANCE_RELEASE_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
DISCUSSION_URL=$(bash ci/create_rc_discussion.sh \
"${{ steps.create.outputs.RC_TAG }}" \
"${{ steps.create.outputs.RC_VERSION }}" \
"${{ inputs.release_branch }}" \
"${{ steps.create.outputs.RELEASE_TYPE }}")
echo "DISCUSSION_URL=$DISCUSSION_URL" >> $GITHUB_OUTPUT
- name: Push changes (if not dry run)
if: ${{ !inputs.dry_run }}
run: |
git push origin "${{ inputs.release_branch }}"
git push origin "${{ steps.create.outputs.RC_TAG }}"
- name: Generate Release Notes (if not dry run)
if: ${{ !inputs.dry_run }}
id: rc_release_notes
env:
GH_TOKEN: ${{ secrets.LANCE_RELEASE_TOKEN }}
run: |
PREVIOUS_TAG="${{ steps.create.outputs.PREVIOUS_TAG }}"
RC_TAG="${{ steps.create.outputs.RC_TAG }}"
if [ -n "${PREVIOUS_TAG}" ]; then
echo "Generating release notes from ${PREVIOUS_TAG} to ${RC_TAG}"
NOTES=$(python ci/generate_release_notes.py ${PREVIOUS_TAG} ${RC_TAG})
else
echo "No previous tag found, using automatic generation"
NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes \
-f tag_name="${RC_TAG}" \
--jq .body)
fi
# Save to output
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Pre-Release (if not dry run)
if: ${{ !inputs.dry_run }}
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
with:
tag_name: ${{ steps.create.outputs.RC_TAG }}
name: ${{ steps.create.outputs.RC_TAG }}
draft: false
prerelease: true
body: ${{ steps.rc_release_notes.outputs.notes }}
token: ${{ secrets.LANCE_RELEASE_TOKEN }}
- name: Summary
run: |
echo "## RC Creation Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Release Branch:** ${{ inputs.release_branch }}" >> $GITHUB_STEP_SUMMARY
echo "- **RC Version:** ${{ steps.create.outputs.RC_VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "- **RC Tag:** ${{ steps.create.outputs.RC_TAG }}" >> $GITHUB_STEP_SUMMARY
echo "- **Dry Run:** ${{ inputs.dry_run }}" >> $GITHUB_STEP_SUMMARY
if [ "${{ inputs.dry_run }}" == "true" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "⚠️ This was a dry run. No changes were pushed." >> $GITHUB_STEP_SUMMARY
else
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ RC ${{ steps.create.outputs.RC_TAG }} created!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Next steps:**" >> $GITHUB_STEP_SUMMARY
echo "1. Check the GitHub Discussion thread for voting" >> $GITHUB_STEP_SUMMARY
echo "2. Test RC artifacts" >> $GITHUB_STEP_SUMMARY
echo "3. Vote on the RC" >> $GITHUB_STEP_SUMMARY
echo "4. If approved, use approve-rc workflow" >> $GITHUB_STEP_SUMMARY
fi