mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 13:32:45 -05:00
Validate draft binaries from the signed release job artifact
This commit is contained in:
1 parent
5d909d6519
commit
9c5e6c7164
2 files changed
+25
-4
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user