ci: add workflow to build test binaries and MSIs on demand#105
Merged
Conversation
Adds .github/workflows/test-build.yml, a workflow_dispatch-only
workflow that produces test binaries and MSIs from an arbitrary commit
without cutting a release tag. The existing release.yml is intentionally
left untouched — it remains the single source of truth for tagged
releases (cosign signing, build-provenance attestation, draft GitHub
release publishing).
Motivation
----------
This fork needs a way to hand out test artifacts for in-progress
changes (e.g. a pre-merge PR review build, an ad-hoc smoke test of a
particular commit) without polluting the release pipeline or
incrementing the version in internal/buildinfo/version.go.
Workflow shape
--------------
Triggered only via workflow_dispatch, with two inputs:
- commit_id (required): the SHA to check out and build from.
- pr_id (optional): a PR number to comment on with the run link.
Three jobs:
build (ubuntu-latest)
- Checks out the requested commit at fetch-depth: 0.
- Reads the build version from internal/buildinfo/version.go for
use by the MSI step.
- Runs `goreleaser release --snapshot --clean --skip=publish` so
no tag is created or pushed, and no draft release is opened on
GitHub. Cosign signing and attestation are deliberately skipped
— they are release-only concerns and would just add cost and
latency for a test build.
- Goreleaser snapshot leaves the per-OS/arch binaries inside
their builder subdirectories (dist/universal_darwin_all/...,
dist/stepsecurity-dev-machine-guard_linux_amd64_v1/..., etc.).
A staging step locates each one via find (mirroring release.yml's
lookup style) and copies it into a flat staging/ directory with
release-style filenames, so artifacts look the same as a real
release and the MSI job's Get-ChildItem filter keeps working.
- Uploads three per-platform artifacts:
* darwin — universal darwin binary
* linux — linux_amd64 + linux_arm64 binaries, .deb, .rpm
* windows-exes — agent + launcher .exes for amd64 and arm64
build-msi (windows-latest)
- Installs WiX 4 + the Util extension (same versions release.yml
uses).
- Downloads the windows-exes artifact into dist/.
- Builds x64 + arm64 MSIs with the same `wix build` invocation as
release.yml.
- Uploads windows-msis as a fourth artifact.
comment-on-pr (ubuntu-latest)
- Runs only when pr_id is non-empty and both build jobs succeed.
- Posts a comment on the PR linking the short SHA (to
github.com/<repo>/commit/<sha>) and the workflow run URL where
reviewers can download the artifacts.
- pull-requests:write is scoped to this job only; the build jobs
run with contents:read.
Hardening
---------
- step-security/harden-runner runs first in every job with
egress-policy: audit.
- All third-party actions are pinned to full commit SHAs with the
version in a trailing comment, matching release.yml and
msi-smoke.yml.
- The top-level permissions block is empty; each job opts into only
the scopes it needs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
varunsh-coder
approved these changes
May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds .github/workflows/test-build.yml, a workflow_dispatch-only workflow that produces test binaries and MSIs from an arbitrary commit without cutting a release tag. The existing release.yml is intentionally left untouched — it remains the single source of truth for tagged releases (cosign signing, build-provenance attestation, draft GitHub release publishing).
Motivation
This fork needs a way to hand out test artifacts for in-progress changes (e.g. a pre-merge PR review build, an ad-hoc smoke test of a particular commit) without polluting the release pipeline or incrementing the version in internal/buildinfo/version.go.
Workflow shape
Triggered only via workflow_dispatch, with two inputs:
Three jobs:
build (ubuntu-latest)
- Checks out the requested commit at fetch-depth: 0.
- Reads the build version from internal/buildinfo/version.go for use by the MSI step.
- Runs
goreleaser release --snapshot --clean --skip=publishso no tag is created or pushed, and no draft release is opened on GitHub. Cosign signing and attestation are deliberately skipped — they are release-only concerns and would just add cost and latency for a test build.- Goreleaser snapshot leaves the per-OS/arch binaries inside their builder subdirectories (dist/universal_darwin_all/..., dist/stepsecurity-dev-machine-guard_linux_amd64_v1/..., etc.). A staging step locates each one via find (mirroring release.yml's lookup style) and copies it into a flat staging/ directory with release-style filenames, so artifacts look the same as a real release and the MSI job's Get-ChildItem filter keeps working.
- Uploads three per-platform artifacts:
* darwin — universal darwin binary
* linux — linux_amd64 + linux_arm64 binaries, .deb, .rpm
* windows-exes — agent + launcher .exes for amd64 and arm64
build-msi (windows-latest)
- Installs WiX 4 + the Util extension (same versions release.yml uses).
- Downloads the windows-exes artifact into dist/.
- Builds x64 + arm64 MSIs with the same
wix buildinvocation as release.yml.- Uploads windows-msis as a fourth artifact.
comment-on-pr (ubuntu-latest)
- Runs only when pr_id is non-empty and both build jobs succeed.
- Posts a comment on the PR linking the short SHA (to github.com//commit/) and the workflow run URL where reviewers can download the artifacts.
- pull-requests:write is scoped to this job only; the build jobs run with contents:read.
Hardening
What does this PR do?
Type of change
Testing
./stepsecurity-dev-machine-guard --verbose./stepsecurity-dev-machine-guard --json | python3 -m json.toolmake lintmake testRelated Issues