From 9c5e6c71640c62b00a7ba97931ad17f9883be0c3 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 18:25:49 +0100 Subject: [PATCH] Validate draft binaries from the signed release job artifact --- .github/workflows/nightly-macos.yml | 14 ++++++++++++-- .github/workflows/windows-arm64.yml | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly-macos.yml b/.github/workflows/nightly-macos.yml index 80ddd22d25..6337634423 100644 --- a/.github/workflows/nightly-macos.yml +++ b/.github/workflows/nightly-macos.yml @@ -6,8 +6,13 @@ on: description: "Release containing the signed macOS DMG" required: true default: "v0.25.0" + release_run: + description: Signed release workflow run ID for a draft + type: string + required: false permissions: contents: read + actions: read jobs: validate: runs-on: macos-15 @@ -20,13 +25,18 @@ jobs: env: GH_TOKEN: ${{ github.token }} RELEASE_TAG: ${{ inputs.release }} + RELEASE_RUN: ${{ inputs.release_run }} run: | set -eu dmg_dir="$RUNNER_TEMP/vectorcraft-dmg" mkdir -p "$dmg_dir" - gh release download "$RELEASE_TAG" --pattern '*macos-universal.dmg' --dir "$dmg_dir" + if [ -n "$RELEASE_RUN" ]; then + gh run download "$RELEASE_RUN" --name release-macos --dir "$dmg_dir" + else + gh release download "$RELEASE_TAG" --pattern '*macos-universal.dmg' --dir "$dmg_dir" + fi mount="$RUNNER_TEMP/vectorcraft-mounted" - hdiutil attach "$dmg_dir"/*.dmg -readonly -nobrowse -mountpoint "$mount" > /dev/null + hdiutil attach "$(find "$dmg_dir" -name '*macos-universal.dmg' -print -quit)" -readonly -nobrowse -mountpoint "$mount" > /dev/null app=$(find "$mount" -name '*.app' -maxdepth 2 | head -1) ditto "$app" "$RUNNER_TEMP/VectorCraft.app" hdiutil detach "$mount" > /dev/null diff --git a/.github/workflows/windows-arm64.yml b/.github/workflows/windows-arm64.yml index b772a08258..4da2d83d60 100644 --- a/.github/workflows/windows-arm64.yml +++ b/.github/workflows/windows-arm64.yml @@ -7,8 +7,13 @@ on: type: string required: true default: v0.25.1 + release_run: + description: Signed release workflow run ID for a draft + type: string + required: false permissions: contents: read + actions: read jobs: validate: runs-on: windows-2022 @@ -22,12 +27,18 @@ jobs: env: GH_TOKEN: ${{ github.token }} RELEASE_TAG: ${{ inputs.release }} + RELEASE_RUN: ${{ inputs.release_run }} run: | $ErrorActionPreference = 'Stop' $download = Join-Path $env:RUNNER_TEMP 'vectorcraft-qa' New-Item -ItemType Directory -Path $download | Out-Null - gh release download $env:RELEASE_TAG --pattern '*windows-x64-portable.zip' --dir $download - $asset = Get-ChildItem $download -Filter '*.zip' | Select-Object -First 1 + if ($env:RELEASE_RUN) { + gh run download $env:RELEASE_RUN --name release-windows-x64 --dir $download + } else { + gh release download $env:RELEASE_TAG --pattern '*windows-x64-portable.zip' --dir $download + } + if ($LASTEXITCODE -ne 0) { throw "Signed artifact download failed." } + $asset = Get-ChildItem $download -Recurse -Filter '*windows-x64-portable.zip' | Select-Object -First 1 Get-FileHash $asset.FullName Expand-Archive $asset.FullName "$download/expanded" $exe = Get-ChildItem "$download/expanded" -Recurse -Filter vectorcraft.exe | Select-Object -First 1