Skip to content

CI: publish blktrace-rs to crates.io when its version changes - #153

Merged
imlk0 merged 1 commit into
masterfrom
publish-blktrace-rs
Oct 15, 2026
Merged

imlk0 merged 1 commit into
masterfrom
publish-blktrace-rs

Conversation

@imlk0

@imlk0 imlk0 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

What

Adds a workflow that publishes the blktrace-rs crate to crates.io
automatically whenever its version on master differs from the latest
published version.

How it works

  • Triggers on master pushes that touch blktrace-rs/Cargo.toml (a version
    bump always does), compares the version against the crates.io API, and
    publishes with cargo publish -p blktrace-rs only when they differ.
  • Uses trusted publishing (RFC 3691): no registry token is stored as a
    repository secret. The rust-lang/crates-io-auth-action step exchanges
    this workflow's GitHub OIDC identity for a short-lived crates.io token
    (granted by permissions: id-token: write), which cargo consumes via
    CARGO_REGISTRY_TOKEN and which is revoked when the job ends.
  • Installs libclang-dev because cargo publish runs a verification
    build, and the crate's build-time bindgen step needs it.

One-time setup on crates.io (maintainer)

The crate's initial 0.1.0 is already published manually. For the trusted
publisher to be authorized, add a Trusted Publisher configuration on the
crates.io blktrace-rs settings page with:

  • owner: openanolis
  • repository: cryptpilot
  • workflow filename: publish-blktrace-rs.yml
  • environment: (none)

Until that configuration exists, a version bump would fail the publish
job on master; afterwards every bump publishes automatically.

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

Runs on master pushes that touch blktrace-rs/Cargo.toml, compares the crate version with the latest published one on crates.io, and publishes when they differ. Uses trusted publishing (RFC 3691): the auth action exchanges the workflow's GitHub OIDC identity for a short-lived crates.io token that is revoked when the job ends, so no registry token is stored as a repository secret.

Assisted-by: Claude:glm-5.3
Signed-off-by: Kun Lai <laikun@linux.alibaba.com>
@imlk0
imlk0 force-pushed the publish-blktrace-rs branch from dac8bac to 61cae5c Compare October 15, 2026 08:51
@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。

@imlk0
imlk0 merged commit 61cae5c into master Oct 15, 2026
14 checks passed
@imlk0
imlk0 deleted the publish-blktrace-rs branch October 15, 2026 09:25
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.

2 participants