Skip to content

Publish a GitHub release per tag with the binary's build records - #13

Open
MihirR-BS wants to merge 1 commit into
mainfrom
release-assets
Open

MihirR-BS wants to merge 1 commit into
mainfrom
release-assets

Conversation

@MihirR-BS

Copy link
Copy Markdown
Collaborator

People who use the k6 binary over a network never receive it, so SOURCE.md could not tell them to read build-info.json or run go version -m inside the image. Each release now publishes those records, and SOURCE.md points at them.

What a release carries (per architecture, built by the reference recipe at that tag)

Asset Contents
build-info-<arch>.json tag, commit, toolkitDir, k6Version, arch, the binary's sha256
go-version-m-<arch>.txt go version -m of the binary: toolchain, build settings, every linked module with its h1: checksum
SHA256SUMS checksums of the files above

The binary itself is not published.

Changes

  • builder.Dockerfile (new): the reference build, moved out of SOURCE.md into a real file so the release runs exactly the documented recipe. Its release-assets target exports only the records.
  • .github/workflows/release.yml (new): builds both architectures and creates the release for a tag (generated notes plus a SOURCE.md link), then uploads the records. Inputs reach the shell only through env and are checked against ^v\d+\.\d+\.\d+$ first.
  • tag-main.yml calls it after tagging: a tag pushed with GITHUB_TOKEN starts no other workflow, so a tag-push trigger would never fire. It can also be run by hand to publish an existing tag.
  • tag-release.sh hands the tag to the next job as a step output (new tests).
  • SOURCE.md: the version section, the toolkit row, the transitive-modules section and the rebuild steps now refer to the release assets, not the image.
  • check-source-md.sh also fails when builder.Dockerfile's Go image or xk6 version drift from SOURCE.md or ci.yml (checked that a changed digest, xk6 version or Go patch each fail).

Why toolkitDir is recorded: Go writes the checkout directory into the binary. Building toolkit v0.1.1 (linux/amd64, Go 1.26.11, xk6 v1.4.12) twice in the same directory gave the same sha256; a third build in a different directory gave a different one, and the only go version -m difference was the => line. So a rebuild matches only when it uses the same directory, and consumers that want their binary to match the release must build in /src/xk6-load-toolkit (the builder.Dockerfile default).

Not run here: release.yml and builder.Dockerfile have not run yet (no Docker on the authoring machine). The first real run is the merge of this PR. After it, run the Release workflow by hand for v0.1.0 (and v0.1.1 if the merge tag does not cover it).

Overlap: #12 also edits SOURCE.md and scripts/check-source-md.sh; whichever lands second needs a small rebase.

Tests run: scripts/tag-release_test.sh, scripts/check-source-md.sh (plus the drift cases above).

🤖 Generated with Claude Code

People who use the k6 binary over a network never receive it, so SOURCE.md
could not ask them to read build-info.json or run `go version -m` inside the
image. Each release now publishes those records instead.

- builder.Dockerfile: the reference build, moved out of SOURCE.md into a real
  file. Besides the binary it writes build-info-<arch>.json (tag, commit,
  toolkitDir, k6Version, arch, sha256) and go-version-m-<arch>.txt; only those
  records leave the build (the binary itself is not published).
- release.yml: builds both architectures with it and creates the GitHub
  release for a tag (generated notes, a SOURCE.md link) with the records and
  their SHA256SUMS. tag-main.yml calls it after tagging, since a tag pushed
  with GITHUB_TOKEN starts no other workflow; it can also be run by hand to
  publish an existing tag.
- tag-release.sh hands the tag to the next job as a step output.
- SOURCE.md identifies a binary by its release tag and points at the release
  assets for the version, the transitive modules and the rebuild recipe,
  which now takes toolkitDir from build-info (Go records the checkout
  directory in the binary).
- check-source-md.sh also fails when builder.Dockerfile's Go image or xk6
  version drift from SOURCE.md or ci.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MihirR-BS
MihirR-BS requested a review from a team as a code owner December 3, 2026 09:32
@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited), Workspace UI (inherited); Enforced overrides: Organization
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 136056ca-fb1c-4f33-892d-2dcb8b222182

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

1 participant