fix(ci): repair release preview and test result publishing
- Release preview: - preview stable releases by comparing a selected ref against `main` instead of rejecting refs that are ahead of `main` - default the preview workflow to `develop` and summarize the candidate commit range in the workflow summary - Test result publishing: - download only the test report artifacts and event payload needed for PR comments/checks - avoid pulling the Buildx `.dockerbuild` artifact that was causing repeated workflow_run failures - Actions runtime: - move `actions/download-artifact` to a Node 24-compatible release line to eliminate the Node 20 deprecation warning in the publisher job
This commit is contained in:
@@ -20,13 +20,23 @@ jobs:
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Download Workflow Artifacts
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
||||
- name: Download Test Report Artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
repository: ${{ github.repository }}
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
path: artifacts
|
||||
pattern: "*-test-reports"
|
||||
|
||||
- name: Download Workflow Event Payload
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
repository: ${{ github.repository }}
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
path: artifacts
|
||||
name: ci-event-file
|
||||
|
||||
- name: Detect Published Test Artifacts
|
||||
id: detect
|
||||
|
||||
@@ -4,9 +4,9 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
description: 'Ref or commit to preview as the next stable release candidate'
|
||||
description: 'Ref or commit to preview as the next stable release candidate promoted onto main'
|
||||
required: false
|
||||
default: main
|
||||
default: develop
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
@@ -24,14 +24,31 @@ jobs:
|
||||
fetch-depth: 0
|
||||
ref: ${{ inputs.ref }}
|
||||
|
||||
- name: Confirm Preview Ref Is Contained By Main
|
||||
- name: Prepare Stable Release Preview
|
||||
run: |
|
||||
set -eu
|
||||
|
||||
git fetch origin main --tags --force
|
||||
if ! git merge-base --is-ancestor HEAD origin/main; then
|
||||
echo "Selected ref is not contained by origin/main"
|
||||
|
||||
if ! git merge-base --is-ancestor origin/main HEAD; then
|
||||
echo "Selected ref does not contain origin/main and cannot be promoted cleanly to main" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Previewing release candidate range origin/main..HEAD"
|
||||
{
|
||||
echo "## Stable Release Preview"
|
||||
echo
|
||||
echo "- Base branch: \`main\`"
|
||||
echo "- Candidate ref: \`$(git rev-parse --short HEAD)\`"
|
||||
echo "- Range: \`origin/main..HEAD\`"
|
||||
echo
|
||||
echo "### Included Commits"
|
||||
git log --reverse --no-merges --pretty='- %h %s' origin/main..HEAD || true
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
git checkout -B main "$(git rev-parse HEAD)"
|
||||
|
||||
- name: Set Up Node.js
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user