Skip to content

Commit 37ce75f

Browse files
feat(ci): package-registry provenance (#94)
## Cargo package-registry provenance crates.io has no native OIDC/trusted-publishing provenance, so this attests the **built `.crate`** via GitHub build-provenance attestation. ### Changes to \`.github/workflows/publish.yml\` (additive only) - Added \`id-token: write\` and \`attestations: write\` to the \`publish\` job permissions (kept existing \`contents: read\`). - Added a real \`cargo package\` step (the workflow previously only ran \`cargo package --list\`, which does not emit a \`.crate\` artifact) so \`target/package/echidnabot-<ver>.crate\` exists. - Added \`actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2\` to attest \`target/package/*.crate\`, placed before publish. ### Notes - Single-crate package (\`echidnabot\`), default manifest path, no workspace / custom working-directory — \`cargo package\` cleanly produces \`target/package/echidnabot-0.1.0.crate\`. - Publish flow (dry-run vs real on tag) is unchanged. - Pre-existing caveat (out of scope, not touched): \`Cargo.toml\` carries a path dependency on \`../../shared-context\` that only resolves inside the gitbot-fleet monorepo; the publish workflow's standalone \`cargo build\`/\`cargo package\` already depends on that being resolvable. No regression introduced here.
1 parent 2eb9e0c commit 37ce75f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
timeout-minutes: 15
2828
permissions:
2929
contents: read
30+
id-token: write
31+
attestations: write
3032
steps:
3133
- name: Checkout
3234
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
@@ -46,6 +48,12 @@ jobs:
4648
run: cargo test --lib
4749
- name: Verify crate can be packaged
4850
run: cargo package --list
51+
- name: Package crate
52+
run: cargo package
53+
- name: Attest crate provenance
54+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
55+
with:
56+
subject-path: 'target/package/*.crate'
4957
- name: Publish to crates.io (dry run)
5058
if: github.event.inputs.dry_run == 'true'
5159
run: cargo publish --dry-run

0 commit comments

Comments
 (0)