Skip to content

chore(release): verify SHA512 against actual archive #691

@kcenon

Description

@kcenon

What

Add SHA512 verify-against-archive step to the release workflow(s) of kcenon/thread_system so that an archive's actual SHA is verified against sha512sum of the GitHub release archive before the new value is committed to the vcpkg overlay registry.

Part of #674 (kcenon/common_system).

Why

kcenon/thread_system's release automation writes SHA512 to the vcpkg overlay portfile without verifying against the actual archive at https://github.com/kcenon/thread_system/archive/refs/tags/v<version>.tar.gz. Audit (kcenon/vcpkg-registry#87) confirmed the port had the same class of mismatch as the other 7 systems. Without verification, cold-cache consumers (new CI runners, new users) hit 100% install failure when the SHA in vcpkg-registry/ports/kcenon-thread-system/portfile.cmake does not match the actual archive.

Where

Item Value
Repository kcenon/thread_system
Release workflow file .github/workflows/release.yml (or release-*.yml family — audit and identify)
Step location After SHA computation, BEFORE committing portfile change
Sync workflow (if separate) sync-vcpkg-registry.yml, on-release-sync-registry.yml (audit)

How

Implementation

Insert the verification step into the release workflow:

# Verify computed SHA against the actual GitHub archive
TAG="$1"           # e.g., v0.2.0
REPO="kcenon/thread_system"
NEW_SHA="$2"       # value the workflow is about to write to portfile.cmake

ARCHIVE_URL="https://github.com/$thread_system/archive/refs/tags/${TAG}.tar.gz"
ACTUAL_SHA=$(curl -fsSL "$ARCHIVE_URL" | sha512sum | awk '{print $1}')

if [ "$NEW_SHA" != "$ACTUAL_SHA" ]; then
    echo "ERROR: SHA mismatch — workflow computed $NEW_SHA, archive has $ACTUAL_SHA" >&2
    exit 1
fi

Acceptance criteria

  • Audit identifies all release workflow files in this repo that compute and write SHA512
  • Each such workflow includes a "verify SHA against actual archive" step that runs AFTER computing the SHA and BEFORE committing the portfile change
  • A deliberate-mismatch test (e.g., bumping the SHA by one character in a feature branch) demonstrates the workflow fails fast with a clear error
  • If the repo has multiple release-related workflows (release, sync-vcpkg-registry, on-release-sync-registry), each is hardened or routed through a shared composite action / reusable workflow

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions