Skip to content

Commit 5e0a44d

Browse files
[Release] Support release candidate publishing and promotion to stable (#8081)
* Handle rc in semver, update docker build * Add rc promotion support * add post1 support * add post1 support
1 parent 7e89b12 commit 5e0a44d

File tree

3 files changed

+128
-14
lines changed

3 files changed

+128
-14
lines changed

.github/workflows/docker-build.yaml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,21 @@ jobs:
248248
- name: Create multi-platform manifest
249249
run: |
250250
# Create multi-platform manifest from temporary tags
251+
VERSION="${{ needs.prepare.outputs.version }}"
252+
253+
# Determine if this is a pre-release version (contains rc, alpha, beta, or dev)
254+
if [[ "$VERSION" =~ (rc|alpha|beta|dev) ]]; then
255+
echo "Pre-release version detected ($VERSION), skipping :latest tag"
256+
TAGS="-t ${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:$VERSION"
257+
else
258+
echo "Stable release version detected ($VERSION), updating :latest tag"
259+
TAGS="-t ${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:latest -t ${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:$VERSION"
260+
fi
261+
251262
docker buildx imagetools create \
252-
-t ${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:latest \
253-
-t ${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:${{ needs.prepare.outputs.version }} \
254-
${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:${{ needs.prepare.outputs.version }}-linux-amd64 \
255-
${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:${{ needs.prepare.outputs.version }}-linux-arm64
263+
$TAGS \
264+
${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:$VERSION-linux-amd64 \
265+
${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:$VERSION-linux-arm64
256266
257267
- name: Clean up temporary tags
258268
if: always()
@@ -274,9 +284,18 @@ jobs:
274284
275285
- name: Summary of final tags
276286
run: |
287+
VERSION="${{ needs.prepare.outputs.version }}"
277288
echo "✅ Multi-platform tags created:"
278-
echo " - ${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:latest"
279-
echo " - ${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:${{ needs.prepare.outputs.version }}"
289+
echo " - ${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:$VERSION"
290+
291+
# Check if latest tag was updated
292+
if [[ "$VERSION" =~ (rc|alpha|beta|dev) ]]; then
293+
echo ""
294+
echo "ℹ️ Pre-release version - :latest tag not updated"
295+
else
296+
echo " - ${{ secrets.DOCKER_USERNAME }}/${{ inputs.package_name }}:latest"
297+
fi
298+
280299
echo ""
281300
echo "🚀 Built with native runners for maximum performance!"
282301
echo "🧹 Temporary tags cleaned up automatically!"

.github/workflows/publish-helm.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,20 @@ jobs:
9292
run: |
9393
version="${{ inputs.version }}"
9494
# Convert PEP440 version to SemVer if needed for Helm versioning
95-
# Handle cases like 1.0.0.dev20250218 -> 1.0.0-dev.20250218
95+
# Handle cases like:
96+
# 1.0.0.dev20250218 -> 1.0.0-dev.20250218
97+
# 0.11.0rc0 -> 0.11.0-rc.0
98+
# 0.11.0a1 -> 0.11.0-alpha.1
99+
# 0.11.0b2 -> 0.11.0-beta.2
100+
# 0.11.0.post1 -> 0.11.0+post.1
96101
semversion=$(echo "$version" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)\.dev([0-9]+)/\1-dev.\2/')
102+
semversion=$(echo "$semversion" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)rc([0-9]+)/\1-rc.\2/')
103+
semversion=$(echo "$semversion" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)a([0-9]+)/\1-alpha.\2/')
104+
semversion=$(echo "$semversion" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)b([0-9]+)/\1-beta.\2/')
105+
# Post-releases use build metadata (+) since SemVer has no direct equivalent to PEP440's .post
106+
# PEP440 .post means "after release", but SemVer build metadata has same precedence.
107+
# TODO(romilb): If both 0.11.0 and 0.11.0+post.1 exist, Helm's "latest" behavior is undefined - some sources claim the newer one wins. Need to verify this.
108+
semversion=$(echo "$semversion" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)\.post([0-9]+)/\1+post.\2/')
97109
98110
# Update the version and name in the main skypilot chart
99111
sed -i "s/^version:.*$/version: ${semversion}/" src/charts/skypilot/Chart.yaml

.github/workflows/release-build.yml

Lines changed: 90 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ on:
66
workflow_dispatch:
77
inputs:
88
release_version:
9-
description: 'Release version (e.g., 0.9.0)'
9+
description: 'Release version (e.g., 0.9.0 or 0.9.0rc1)'
1010
required: false
1111
type: string
1212
skip_version_checks:
1313
description: 'Skip version verification steps'
1414
required: false
1515
type: boolean
1616
default: false
17+
skip_smoke_tests:
18+
description: 'Skip smoke tests (recommended when promoting tested RC to stable)'
19+
required: false
20+
type: boolean
21+
default: false
1722

1823
jobs:
1924
release-build:
@@ -184,6 +189,10 @@ jobs:
184189
185190
smoke-tests:
186191
needs: release-build
192+
if: |
193+
always() &&
194+
needs.release-build.result == 'success' &&
195+
github.event.inputs.skip_smoke_tests != 'true'
187196
uses: ./.github/workflows/buildkite-trigger-wait.yml
188197
with:
189198
commit: ${{ needs.release-build.outputs.new_commit_sha }}
@@ -198,6 +207,10 @@ jobs:
198207

199208
quicktest-core:
200209
needs: release-build
210+
if: |
211+
always() &&
212+
needs.release-build.result == 'success' &&
213+
github.event.inputs.skip_smoke_tests != 'true'
201214
uses: ./.github/workflows/buildkite-trigger-wait.yml
202215
with:
203216
commit: ${{ needs.release-build.outputs.new_commit_sha }}
@@ -213,6 +226,10 @@ jobs:
213226

214227
quicktest-core-previous-minor:
215228
needs: release-build
229+
if: |
230+
always() &&
231+
needs.release-build.result == 'success' &&
232+
github.event.inputs.skip_smoke_tests != 'true'
216233
uses: ./.github/workflows/buildkite-trigger-wait.yml
217234
with:
218235
commit: ${{ needs.release-build.outputs.new_commit_sha }}
@@ -228,6 +245,10 @@ jobs:
228245

229246
smoke-tests-remote-server-kubernetes:
230247
needs: release-build
248+
if: |
249+
always() &&
250+
needs.release-build.result == 'success' &&
251+
github.event.inputs.skip_smoke_tests != 'true'
231252
uses: ./.github/workflows/buildkite-trigger-wait.yml
232253
with:
233254
commit: ${{ needs.release-build.outputs.new_commit_sha }}
@@ -244,6 +265,10 @@ jobs:
244265

245266
release-tests:
246267
needs: release-build
268+
if: |
269+
always() &&
270+
needs.release-build.result == 'success' &&
271+
github.event.inputs.skip_smoke_tests != 'true'
247272
uses: ./.github/workflows/buildkite-trigger-wait.yml
248273
with:
249274
commit: ${{ needs.release-build.outputs.new_commit_sha }}
@@ -268,13 +293,47 @@ jobs:
268293
- name: Create release branch and PR
269294
env:
270295
GH_TOKEN: ${{ secrets.GH_PAT_FOR_RELEASE }}
296+
TEST_BRANCH: ${{ needs.release-build.outputs.test_branch }}
297+
RELEASE_BRANCH: ${{ needs.release-build.outputs.release_branch }}
298+
RELEASE_VERSION: ${{ needs.release-build.outputs.release_version }}
299+
SKIP_SMOKE_TESTS: ${{ github.event.inputs.skip_smoke_tests }}
271300
run: |
272301
# Configure git
273302
git config --local user.email "[email protected]"
274303
git config --local user.name "GitHub Action"
275304
276-
# Create PR with buildkite links
277-
PR_BODY="Release ${{ needs.release-build.outputs.release_version }}
305+
# Detect if this is an RC promotion
306+
SOURCE_BRANCH="${{ github.ref_name }}"
307+
IS_RC_PROMOTION="false"
308+
if [[ "$SOURCE_BRANCH" =~ ^releases/.*rc[0-9]+$ ]]; then
309+
IS_RC_PROMOTION="true"
310+
RC_VERSION=$(echo "$SOURCE_BRANCH" | sed 's/releases\///')
311+
fi
312+
313+
# Build PR body based on whether tests were skipped
314+
if [ "$SKIP_SMOKE_TESTS" == "true" ]; then
315+
if [ "$IS_RC_PROMOTION" == "true" ]; then
316+
PR_BODY="## Promote RC to Stable Release ${RELEASE_VERSION}
317+
318+
**Source:** \`$SOURCE_BRANCH\` (RC version: $RC_VERSION)
319+
**Target:** Stable release \`${RELEASE_VERSION}\`
320+
321+
⚠️ **Smoke tests were SKIPPED** - This release is being promoted from a tested RC.
322+
323+
### Pre-release Testing
324+
This version was previously tested as release candidate \`$RC_VERSION\` and deemed stable by early adopters.
325+
326+
### Changes in this PR
327+
- Updated \`sky/__init__.py\`: \`$RC_VERSION\` → \`${RELEASE_VERSION}\`
328+
- Updated \`charts/skypilot/values.yaml\`: Docker image tag \`$RC_VERSION\` → \`${RELEASE_VERSION}\`"
329+
else
330+
PR_BODY="Release ${RELEASE_VERSION}
331+
332+
⚠️ **Smoke tests were SKIPPED** - Please ensure manual testing was performed."
333+
fi
334+
else
335+
# Normal release with test results
336+
PR_BODY="Release ${RELEASE_VERSION}
278337
279338
Buildkite Test Links:
280339
- [Full Smoke Tests](https://buildkite.com/skypilot-1/full-smoke-tests-run/builds/${{ needs.smoke-tests.outputs.build_number }}) - $([ "${{ needs.smoke-tests.outputs.build_status }}" == "success" ] && echo "✅ Success" || echo "❌ Failed")
@@ -284,17 +343,40 @@ jobs:
284343
- [Release Tests](https://buildkite.com/skypilot-1/release/builds/${{ needs.release-tests.outputs.build_number }}) - ⏳ (not waiting for completion)
285344
286345
*Release Tests may take up to 24 hours to complete and might fail due to resource constraints.*"
346+
fi
287347
288-
echo "Creating PR from ${{ needs.release-build.outputs.test_branch }} to ${{ needs.release-build.outputs.release_branch }}"
348+
echo "Creating PR from ${TEST_BRANCH} to ${RELEASE_BRANCH}"
289349
290-
gh pr create --base ${{ needs.release-build.outputs.release_branch }} --head ${{ needs.release-build.outputs.test_branch }} \
291-
--title "Release ${{ needs.release-build.outputs.release_version }}" \
350+
gh pr create --base ${RELEASE_BRANCH} --head ${TEST_BRANCH} \
351+
--title "Release ${RELEASE_VERSION}" \
292352
--body "${PR_BODY}"
293353
294354
- name: Summary
295355
if: always()
356+
env:
357+
SKIP_SMOKE_TESTS: ${{ github.event.inputs.skip_smoke_tests }}
296358
run: |
297-
cat <<EOF >> "$GITHUB_STEP_SUMMARY"
359+
if [ "$SKIP_SMOKE_TESTS" == "true" ]; then
360+
SOURCE_BRANCH="${{ github.ref_name }}"
361+
if [[ "$SOURCE_BRANCH" =~ ^releases/.*rc[0-9]+$ ]]; then
362+
RC_VERSION=$(echo "$SOURCE_BRANCH" | sed 's/releases\///')
363+
cat <<EOF >> "$GITHUB_STEP_SUMMARY"
364+
# Release ${{ needs.release-build.outputs.release_version }}
365+
366+
## RC Promotion
367+
Promoting from \`$RC_VERSION\` to stable version \`${{ needs.release-build.outputs.release_version }}\`
368+
369+
⚠️ **Smoke tests were SKIPPED** - This release was promoted from a tested RC.
370+
EOF
371+
else
372+
cat <<EOF >> "$GITHUB_STEP_SUMMARY"
373+
# Release ${{ needs.release-build.outputs.release_version }}
374+
375+
⚠️ **Smoke tests were SKIPPED** - Please ensure manual testing was performed.
376+
EOF
377+
fi
378+
else
379+
cat <<EOF >> "$GITHUB_STEP_SUMMARY"
298380
# Release ${{ needs.release-build.outputs.release_version }}
299381
300382
## Buildkite Test Links
@@ -306,3 +388,4 @@ jobs:
306388
307389
*Release Tests may take up to 24 hours to complete and might fail due to resource constraints.*
308390
EOF
391+
fi

0 commit comments

Comments
 (0)