Select one available release artifact pair for every RPM smoke job

This commit is contained in:
Codex committed 2026-11-29 21:34:39 +01:00
1 parent 1dc94103da
commit 28d0f76bfe
1 file changed
+28 -5
+28 -5
View File
@@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
run-id:
description: Release workflow run containing the RPM artifacts (empty selects latest release branch run)
description: Release run containing both RPM artifacts (empty selects the latest available pair)
type: string
default: ""
pull_request:
@@ -17,7 +17,33 @@ permissions:
actions: read
jobs:
source:
runs-on: ubuntu-24.04
timeout-minutes: 5
outputs:
run-id: ${{ steps.source.outputs.run-id }}
steps:
- id: source
env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ inputs.run-id }}
run: |
candidates="$RUN_ID"
if [ -z "$candidates" ]; then
candidates=$(gh run list --repo "$GITHUB_REPOSITORY" --workflow release.yml --branch release --limit 10 --json databaseId --jq '.[].databaseId')
fi
for candidate in $candidates; do
[[ "$candidate" =~ ^[0-9]+$ ]]
names=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$candidate/artifacts?per_page=100" --jq '.artifacts[] | select(.expired == false) | .name')
if grep -Fxq release-linux-x86_64 <<< "$names" && grep -Fxq release-linux-aarch64 <<< "$names"; then
printf 'run-id=%s\n' "$candidate" >> "$GITHUB_OUTPUT"
exit 0
fi
done
echo '::error::No release run has both Linux package artifacts available'
exit 1
smoke:
needs: source
timeout-minutes: 25
strategy:
fail-fast: false
@@ -34,12 +60,9 @@ jobs:
- name: Download the release packages
env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ inputs.run-id }}
RUN_ID: ${{ needs.source.outputs.run-id }}
ARCH: ${{ matrix.platform.arch }}
run: |
if [ -z "$RUN_ID" ]; then
RUN_ID=$(gh run list --workflow release.yml --branch release --limit 1 --json databaseId --jq '.[0].databaseId')
fi
[[ "$RUN_ID" =~ ^[0-9]+$ ]]
mkdir -p packages results
gh run view "$RUN_ID" --json headSha,url > results/source.json