Skip to content

deploy: attach the published .crate to the GitHub release (closes #7434) - #14337

Merged
TrapsterDK merged 1 commit into
mainfrom
issue-7434-attach-crate
Nov 21, 2026
Merged

TrapsterDK merged 1 commit into
mainfrom
issue-7434-attach-crate

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Closes #7434

With attach = True, a live github_deploy now downloads <name>-<ver>.crate from crates.io and uploads it with the other release assets, so cosign signs it and reusable-release.yml attests the bytes crates.io serves.

  • deploy/private/src/crates.rs: CRATES_INDEX/CRATES_DL constants; fetch_published_crate reads the sparse-index cksum, downloads the .crate (64 MiB cap), checks sha256, and walks the archive: every member under <name>-<ver>/, Cargo.toml.orig equal to the pinned manifest, Cargo.toml/Cargo.lock/.cargo_vcs_info.json skipped, every other member equal to the pinned file. New typed errors NotPublished, ChecksumMismatch, ForeignMember, Fetch, InvalidCrate.
  • deploy/private/src/github.rs: Attestation.attach; the live run fetches attached crates into outdir/crates and recomputes asset names (a name collision fails); the dry run prints asset: <name>-<ver>.crate (crates.io, after crates_deploy publishes).
  • deploy/private/github.bzl: attach is set on crates attestations.
  • .github/workflows/reusable-release.yml: registry_deploys of the deployables run first.
  • Docs: deploy/README.md, .github/workflows/README.md.

Risks for review:

  • Assumes cargo publish waits for the index to list the new version (Cargo >= 1.66).
  • Manual dx deploy --apply users must run crates_deploy before github_deploy.
  • The labels(registry_deploys, deps(set(...), 1)) query in a consumer without registry_deploys is expected to return empty; not proven by a release run.

Tests (local, linux_x86_64):

  • bazel test //deploy/private:dx_deploy_tools_test //deploy/private:github_attestation //deploy/private:github_unit -> 3 pass (5 new fetch_published_crate_* tests).
  • bazel test //tools/ci:actionlint_test -> pass; actionlint on reusable-release.yml -> clean.
  • clippy aspect on //deploy/private:dx_deploy_tools{,_test}: no new warnings.
  • Not run: nested-Bazel and *_consumer_test targets (CI runs them).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hzWDHEg9zNhhTJrJ7t

With attach = True, a live github_deploy downloads <name>-<ver>.crate
from crates.io, checks its sha256 against the sparse-index cksum and
checks that every member is a pinned source (Cargo.toml.orig equals the
pinned manifest), then uploads it with the other assets so cosign signs
it and reusable-release.yml attests it. reusable-release.yml now runs the
registry_deploys of a github_deploy first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzWDHEg9zNhhTJrJ7t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Touches review paths; needs a second-session Review: comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploy: crates_deploy and maven_deploy print the attestation URL into the GitHub release body

1 participant