Skip to content

Commit d5529e7

Browse files
committed
fix(ci): isolate release archive downloads
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 5c18e3f commit d5529e7

4 files changed

Lines changed: 24 additions & 7 deletions

File tree

‎.github/workflows/dry-run.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ jobs:
146146
with:
147147
pattern: binaries-*
148148
merge-multiple: true
149-
path: assets
149+
path: ${{ runner.temp }}/release-archives
150150

151151
# Same extraction the release verify job performs, so the bytes handed to
152152
# VirusTotal here are the bytes a user would download and run.
153153
- name: Extract archive artifacts
154154
run: |
155-
scripts/ci/extract-release-archives.sh assets binaries \
155+
scripts/ci/extract-release-archives.sh "$RUNNER_TEMP/release-archives" binaries \
156156
--archive-scope=ui \
157157
--expect-archives=8 \
158158
--expect-binaries=8 \

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,10 @@ jobs:
212212
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
213213
VERSION: ${{ inputs.version }}
214214
run: |
215-
mkdir -p assets binaries
216-
gh release download "$VERSION" --dir assets --repo "$GITHUB_REPOSITORY" --pattern '*.tar.gz' --pattern '*.zip'
217-
scripts/ci/extract-release-archives.sh assets binaries \
215+
ARCHIVE_DIR="$RUNNER_TEMP/release-archives"
216+
mkdir -p "$ARCHIVE_DIR" binaries
217+
gh release download "$VERSION" --dir "$ARCHIVE_DIR" --repo "$GITHUB_REPOSITORY" --pattern '*.tar.gz' --pattern '*.zip'
218+
scripts/ci/extract-release-archives.sh "$ARCHIVE_DIR" binaries \
218219
--expect-archives=16 \
219220
--expect-binaries=16 \
220221
--expect-packs=8 \

‎tests/test_release_archive_extractor_contract.sh‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,21 @@ if dry_run.count("ui_only: true") != 2 or "--archive-scope=ui" not in dry_run:
528528
fail("dry-run must build, smoke and extract only the UI runtime set")
529529
if "--archive-scope=ui" in release:
530530
fail("release workflow must retain its dual-variant compatibility scope")
531+
if (
532+
"path: ${{ runner.temp }}/release-archives" not in dry_run
533+
or 'extract-release-archives.sh "$RUNNER_TEMP/release-archives" binaries' not in dry_run
534+
or "path: assets" in dry_run
535+
or "extract-release-archives.sh assets binaries" in dry_run
536+
):
537+
fail("dry-run must isolate downloaded archives from tracked checkout assets")
538+
if (
539+
'ARCHIVE_DIR="$RUNNER_TEMP/release-archives"' not in release
540+
or '--dir "$ARCHIVE_DIR"' not in release
541+
or 'extract-release-archives.sh "$ARCHIVE_DIR" binaries' not in release
542+
or "--dir assets" in release
543+
or "extract-release-archives.sh assets binaries" in release
544+
):
545+
fail("release verification must isolate downloaded archives from tracked checkout assets")
531546
for workflow_name, workflow, arguments in (
532547
("release", release, count_args),
533548
("dry-run", dry_run, ui_count_args),

‎tests/test_smoke_fixture_contract.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,9 @@ require(
419419
"finalize while the activation callback still owns the guard",
420420
)
421421
require(
422-
"scripts/ci/extract-release-archives.sh assets binaries" in release_workflow,
423-
"release verification must use the canonical archive extractor",
422+
'ARCHIVE_DIR="$RUNNER_TEMP/release-archives"' in release_workflow
423+
and 'scripts/ci/extract-release-archives.sh "$ARCHIVE_DIR" binaries' in release_workflow,
424+
"release verification must feed the canonical extractor from an isolated archive directory",
424425
)
425426
require(
426427
"cbm-release-scan-associations-v2" in release_extractor

0 commit comments

Comments
 (0)