Skip to content

Action: run the release binary natively on Windows and macOS (#61) - #72

Merged
SebHenn merged 2 commits into
mainfrom
feat/issue-61-native-binary
Oct 27, 2026
Merged

SebHenn merged 2 commits into
mainfrom
feat/issue-61-native-binary

Conversation

@SebHenn

@SebHenn SebHenn commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Closes #61.

The action ran everything through docker run, so it was Linux-only. A .NET test job on windows-latest couldn't use it at all, or pair it with dotnet-tia's action, which runs on all three OSes. Every Linux run also paid for an image pull and two or three container starts.

runtime: auto | docker | binary (default auto)

  • auto: Docker on Linux, or whenever image: is set; the binary on Windows and macOS.
  • binary: downloads cifail-<stamp>-<rid>.(zip|tar.gz) of the action's own release (the same version stamp the image tag uses, so pinning the action pins the code) plus its .sha256 from that release. The RID comes from RUNNER_OS and RUNNER_ARCH.
    • It checks the sha256 on every run, cached or not; a mismatch deletes the files and exits 2 without running anything.
    • It extracts with unzip, or Windows' own tar.exe (bsdtar reads zip; Git Bash's GNU tar can't), or tar -xzf, into RUNNER_TOOL_CACHE/cifail/<ver>/<rid>, which persists on self-hosted runners.
    • CIFAIL_BINARY points at a binary already on disk.
  • binary with image: is refused as a contradiction.
  • The provenance line names binary <archive> sha256 <hash> instead of the image digest. image-digest is empty in binary mode.
  • In binary mode there's no workspace mount, so the persisted-credential warning and docker pull are skipped. The tia report is passed by path instead of a mount, and CIFAIL_DB_* reach the binary through the environment.

Portability: same_commit (from #58) used ${1,,}, which is bash 4. macOS's /bin/bash is 3.2, so it now lowercases with tr. Runner paths are converted with cygpath under Git Bash.

Verified

  • Locally on Windows (Git Bash) against the real v0.5.0 release:
    • The action script downloaded cifail-0.5.0-win-x64.zip, verified it, unzipped it and ran it. The provenance line was … | cifail 0.5.0 | binary cifail-0.5.0-win-x64.zip sha256 ab23db3a…, and the outputs were rule=nuget-nu1101, matched=true.
    • A second run used the cache.
    • A tampered .sha256 was refused, exit 2, and the files were removed.
  • CI:
    • build-test-windows runs the action script through Git Bash with runtime: auto and stamp 0.5.0, a published release, because this version isn't out yet.
    • docker-smoke runs runtime: binary on Linux the same way and checks that binary plus image: is refused.
  • actionlint is clean. Shellcheck on the action shows the same single finding as main.

Not covered: macOS has no CI job here. Its path is the same tar.gz branch that Linux CI exercises, plus shasum instead of sha256sum.

🤖 Generated with Claude Code

SebHenn and others added 2 commits October 27, 2026 17:36
runtime: auto (default) keeps the Docker image on Linux and, on Windows and
macOS, downloads the self-contained binary of the action's own release,
checks it against the published sha256 on every run, and runs it. runtime:
binary does that on Linux too. The provenance line names the archive and its
sha256. same_commit no longer uses bash-4 lowercasing, for macOS's bash 3.2.
CI runs the binary path on ubuntu and, through Git Bash, on windows-latest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SebHenn
SebHenn merged commit c7f73dd into main Oct 27, 2026
7 checks passed
@SebHenn
SebHenn deleted the feat/issue-61-native-binary branch October 27, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Action: run the release binary natively on Windows and macOS runners instead of Docker only

1 participant