Skip to content

ci(release): tag-driven release with attested binaries and crates.io trusted publishing (LAB-5117) - #4

Merged
27Bslash6 merged 5 commits into
mainfrom
lab-5117-release-workflow
Oct 3, 2026
Merged

27Bslash6 merged 5 commits into
mainfrom
lab-5117-release-workflow

Conversation

@27Bslash6

Copy link
Copy Markdown
Contributor

Adds .github/workflows/release.yml and an install section in the README.

A version tag (v0.1.0, v0.2.0-rc.1) runs four jobs, all on GitHub-hosted runners:

  1. check: the tag must equal v plus the crate version, the tagged commit must be on main, and cargo package --locked must build.
  2. build: static musl binaries for x86_64 and aarch64 Linux and a binary for Apple silicon. Each job runs the test suite on its own target before it builds. These jobs hold only contents: read, so dependency build scripts never see a signing or publishing token.
  3. release: attests each archive and the ck binary inside it with actions/attest (the action attest-build-provenance now wraps), then creates the GitHub Release. A tag with a - makes a pre-release.
  4. publish: exchanges the job's OIDC token for a short-lived crates.io token (trusted publishing, release environment) and runs cargo publish. It runs last because a crates.io version can never be republished.

No installer script ships. The README documents cargo install --locked cachekit-cli and the pinned verify command, and says why --owner cachekit-io alone is not enough.

Before the first tag, the crate must exist on crates.io with this workflow registered as its trusted publisher, and the repository must be public, because artifact attestations need a public repository on this plan.

Closes LAB-5117

…trusted publishing (LAB-5117)

A version tag on a commit in main builds static Linux (x86_64, aarch64)
and Apple silicon binaries on GitHub-hosted runners, tests each target,
attests the archives and the binaries in them, creates the GitHub
Release, and then publishes the crate through crates.io trusted
publishing, so the repo holds no registry token.

The README gains an install section: cargo install --locked, and the
pinned gh attestation verify command for release binaries.
@kodus-27b

kodus-27b Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

Kody Code Review — 2 suggested fixes.
Paste the prompt below to your agent and all review fixed at once!

🛠️ Open Agent Prompt
A code review identified the following issues in this pull request.
Each section describes what was found and includes a reference implementation where available.

Files involved:
- .github/workflows/release.yml:41
- .github/workflows/release.yml:153

---

### [1/2] .github/workflows/release.yml:41
Issue identified during code review:
Trust-boundary bypass in the "Tagged commit is on main" step: the main-ancestry check runs from whatever release.yml exists at the tagged commit, so the workflow it protects can remove it. When anyone with tag-push rights tags an unreviewed commit whose release.yml drops this step, the `release` job still runs with contents/attestations/id-token write and no environment gate and signs as `.github/workflows/release.yml@refs/tags/vX`. The README verification command (`--repo`, path-only `--signer-workflow`, `--deny-self-hosted-runners`) accepts that attestation, which breaks the guarantee that only reviewed code on main is released. Fix: restrict `v*` tag creation with a repository tag ruleset and gate the `release` job on a protected `release` environment with deployment rules limited to `v*` tags, optionally having users pin `--signer-digest` or `--source-digest`.
Reference implementation (from code review):

// .github/workflows/release.yml:41
release:
    needs: build
    runs-on: ubuntu-latest
    timeout-minutes: 15
    # Gate signing on a protected environment (deployment rules: tags v*),
    # and protect v* tag creation with a repository ruleset, because the
    # main-ancestry check above runs from the tagged commit's own workflow file.
    environment: release
    permissions:
      contents: write
      id-token: write
      attestations: write

---

### [2/2] .github/workflows/release.yml:153
Issue identified during code review:
Bootstrap failure in the `publish` job: `rust-lang/crates-io-auth-action` requires a trusted publisher, which crates.io only allows on an existing crate, and this crate is unpublished (Cargo.toml is at 0.0.0, and the replaced README states nothing is published yet). When `v0.1.0` is pushed, the `release` job creates the GitHub Release and then the auth step in `publish` fails, so the version exists on GitHub but not on crates.io and the README's `cargo install --locked cachekit-cli` fails. Fix: before tagging, publish the first version (or a placeholder) manually with an API token and configure the trusted publisher, or document this bootstrap step next to the `publish` job.
Reference implementation (from code review):

// .github/workflows/release.yml:153
# Prerequisite: the crate must already exist on crates.io and have this
      # workflow + `release` environment registered as a trusted publisher.
      # Publish the first version manually with an API token before tagging.
      - uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5
        id: auth

---

Review each issue in context, use the reference implementations as guidance, and apply fixes that are consistent with the surrounding codebase.

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
A rerun after a failed publish found the release already there, so
gh release create failed and the publish job never ran again. The step
now replaces the existing release's archives with the rerun's attested
ones and carries on to publish.
Comment thread .github/workflows/release.yml
@kodus-27b

kodus-27b Bot commented Oct 3, 2026

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

@kodus-27b

kodus-27b Bot commented Oct 3, 2026

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

kodus-27b[bot]
kodus-27b Bot previously approved these changes Oct 3, 2026
Comment thread .github/workflows/release.yml Outdated
@kodus-27b

kodus-27b Bot commented Oct 3, 2026

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

@kodus-27b

kodus-27b Bot commented Oct 3, 2026

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

@27Bslash6
27Bslash6 merged commit c3297dd into main Oct 3, 2026
5 checks passed
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