Skip to content

Commit 8f761ff

Browse files
committed
support new release mechanism
1 parent 8b952b7 commit 8f761ff

4 files changed

Lines changed: 526 additions & 167 deletions

File tree

.github/workflows/create-release-branch.yml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Create Release Branch
33
on:
44
workflow_dispatch:
55
inputs:
6+
source_release_branch:
7+
description: 'Source release branch (optional, e.g., release/v1.3). Leave empty to create from main.'
8+
required: false
9+
type: string
10+
default: ''
611
dry_run:
712
description: 'Dry run (simulate without pushing)'
813
required: true
@@ -25,7 +30,7 @@ jobs:
2530
- name: Check out repository
2631
uses: actions/checkout@v4
2732
with:
28-
ref: main
33+
ref: ${{ inputs.source_release_branch || 'main' }}
2934
token: ${{ secrets.LANCE_RELEASE_TOKEN }}
3035
fetch-depth: 0
3136
lfs: true
@@ -39,16 +44,25 @@ jobs:
3944
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4045
GITHUB_REPOSITORY: ${{ github.repository }}
4146
run: |
42-
bash ci/create_release_branch.sh
47+
bash ci/create_release_branch.sh "${{ inputs.source_release_branch }}"
4348
4449
- name: Push changes (if not dry run)
4550
if: ${{ !inputs.dry_run }}
4651
run: |
4752
git push origin "${{ steps.create_branch.outputs.RELEASE_BRANCH }}"
48-
git push origin main
4953
git push origin "${{ steps.create_branch.outputs.RC_TAG }}"
50-
# Push release root tag (may already exist remotely if created during beta publish)
51-
git push origin "${{ steps.create_branch.outputs.RELEASE_ROOT_TAG }}" || echo "Release root tag already exists remotely"
54+
# When creating from main: push main and release root tag
55+
# When creating from release branch: push minor release base tag
56+
if [ -z "${{ inputs.source_release_branch }}" ]; then
57+
git push origin main
58+
# Push release root tag (may already exist remotely if created during beta publish)
59+
git push origin "${{ steps.create_branch.outputs.RELEASE_ROOT_TAG }}" || echo "Release root tag already exists remotely"
60+
else
61+
# Push minor release base tag if it was created
62+
if [ -n "${{ steps.create_branch.outputs.MINOR_RELEASE_BASE_TAG }}" ]; then
63+
git push origin "${{ steps.create_branch.outputs.MINOR_RELEASE_BASE_TAG }}"
64+
fi
65+
fi
5266
5367
- name: Generate Release Notes (if not dry run)
5468
if: ${{ !inputs.dry_run }}
@@ -106,9 +120,18 @@ jobs:
106120
echo "- **Target Version:** ${{ steps.create_branch.outputs.RC_VERSION }}" >> $GITHUB_STEP_SUMMARY
107121
echo "- **RC Tag:** ${{ steps.create_branch.outputs.RC_TAG }}" >> $GITHUB_STEP_SUMMARY
108122
echo "- **Release Branch:** ${{ steps.create_branch.outputs.RELEASE_BRANCH }}" >> $GITHUB_STEP_SUMMARY
109-
echo "- **Release Root Tag:** ${{ steps.create_branch.outputs.RELEASE_ROOT_TAG }}" >> $GITHUB_STEP_SUMMARY
110-
echo "- **Main Version:** ${{ steps.create_branch.outputs.MAIN_VERSION }}" >> $GITHUB_STEP_SUMMARY
111-
echo "- **Source Branch:** main (HEAD)" >> $GITHUB_STEP_SUMMARY
123+
124+
if [ -z "${{ inputs.source_release_branch }}" ]; then
125+
echo "- **Release Root Tag:** ${{ steps.create_branch.outputs.RELEASE_ROOT_TAG }}" >> $GITHUB_STEP_SUMMARY
126+
echo "- **Main Version:** ${{ steps.create_branch.outputs.MAIN_VERSION }}" >> $GITHUB_STEP_SUMMARY
127+
echo "- **Source Branch:** main (HEAD)" >> $GITHUB_STEP_SUMMARY
128+
else
129+
echo "- **Source Branch:** ${{ inputs.source_release_branch }}" >> $GITHUB_STEP_SUMMARY
130+
echo "- **Release Notes Base:** ${{ steps.create_branch.outputs.PREVIOUS_TAG }}" >> $GITHUB_STEP_SUMMARY
131+
if [ -n "${{ steps.create_branch.outputs.MINOR_RELEASE_BASE_TAG }}" ]; then
132+
echo "- **Minor Release Base Tag:** ${{ steps.create_branch.outputs.MINOR_RELEASE_BASE_TAG }}" >> $GITHUB_STEP_SUMMARY
133+
fi
134+
fi
112135
echo "- **Dry Run:** ${{ inputs.dry_run }}" >> $GITHUB_STEP_SUMMARY
113136
114137
if [ "${{ inputs.dry_run }}" == "true" ]; then
@@ -122,7 +145,11 @@ jobs:
122145
echo "" >> $GITHUB_STEP_SUMMARY
123146
echo "**What happened:**" >> $GITHUB_STEP_SUMMARY
124147
echo "1. Created release branch ${{ steps.create_branch.outputs.RELEASE_BRANCH }} at ${{ steps.create_branch.outputs.RC_TAG }}" >> $GITHUB_STEP_SUMMARY
125-
echo "2. Bumped main to ${{ steps.create_branch.outputs.MAIN_VERSION }} (unreleased)" >> $GITHUB_STEP_SUMMARY
148+
if [ -z "${{ inputs.source_release_branch }}" ]; then
149+
echo "2. Bumped main to ${{ steps.create_branch.outputs.MAIN_VERSION }} (unreleased)" >> $GITHUB_STEP_SUMMARY
150+
else
151+
echo "2. Created from ${{ inputs.source_release_branch }} (main unchanged)" >> $GITHUB_STEP_SUMMARY
152+
fi
126153
echo "" >> $GITHUB_STEP_SUMMARY
127154
echo "**Next steps:**" >> $GITHUB_STEP_SUMMARY
128155
echo "1. Review and vote in the discussion thread" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)