Skip to content

ci: registry-only smoke + idempotent auto-publish on main#2

Merged
troyjr4103 merged 1 commit into
mainfrom
ci/registry-smoke-and-autopublish
Jun 17, 2026
Merged

ci: registry-only smoke + idempotent auto-publish on main#2
troyjr4103 merged 1 commit into
mainfrom
ci/registry-smoke-and-autopublish

Conversation

@troyjr4103

Copy link
Copy Markdown
Contributor

What

Hardens registry publishing so the version-skew bug (kin-model's API changed without a registry version bump; kin-db 0.2.0 then pinned the stale kin-model 0.1.0 and only built locally because .cargo/config.toml patches deps to sibling checkouts) can no longer reach main undetected.

Adds .github/workflows/registry-publish.yml and a publish script.

registry_smoke — safety net (runs on PRs + main)

  • Rewrites .cargo/config.toml to contain ONLY the [registries.kin] alias (sparse+https://kinlab.ai/registry/cargo/), stripping the [patch.kin] redirects for kin-blobs / kin-vector.
  • cargo build against the real published registry. A crate that cannot resolve/build from the registry fails CI before merge.

registry_publish — idempotent auto-publish (push to main, needs: registry_smoke)

  • Packages and POSTs the crate to the KinLab registry via the new scripts/publish-kinlab-crates.sh.
  • HTTP 409 (already published) is treated as success, so re-running on an unchanged version is a no-op.
  • Only runs after registry_smoke passes.

New publish script — version-from-Cargo.toml

scripts/publish-kinlab-crates.sh is modeled on kin-db's (cargo package + POST to /registry/cargo/api/v1/crates/publish with authorization: Bearer). It derives the version from cargo metadata (Cargo.toml), so a version-bump merge auto-publishes without a git tag. TAG_NAME / a tag-typed GITHUB_REF_NAME is honored as an optional consistency check.

Secrets / vars — ACTION NEEDED

This repo has no prior registry-publish workflow, so it likely needs KINLAB_CARGO_TOKEN (secret) and KINLAB_CARGO_REGISTRY_URL (var) provisioned before the publish job can run. I did not set these.

Validation

  • bash -n scripts/publish-kinlab-crates.sh passes.
  • registry-publish.yml parses (yaml.safe_load).
  • Dry-run: version resolves to 0.2.0 from Cargo.toml with no tag.

No cargo publish / registry POST was run; no secrets were modified.

Add registry-publish.yml with two jobs:

- registry_smoke (PRs + main): rewrites .cargo/config.toml to the
  registry alias only (no [patch.kin] sibling-checkout redirects), then
  cargo build. This catches a crate that cannot resolve/build from the
  published registry — the version-skew failure that local patched CI
  hides (kin-model's API changed without a registry bump, then kin-db
  0.2.0 pinned the stale 0.1.0).

- registry_publish (push to main, needs: registry_smoke): packages and
  POSTs the crate to the KinLab registry idempotently (HTTP 409 =
  already published = success).

Add scripts/publish-kinlab-crates.sh (modeled on kin-db's) that derives
the version from Cargo.toml (cargo metadata), so a version-bump merge
auto-publishes without a git tag. TAG_NAME / a tag-typed GITHUB_REF_NAME
is honored as an optional consistency check.

Signed-off-by: Troy Fortin <troy@firelock.io>
@troyjr4103 troyjr4103 merged commit b216a4e into main Jun 17, 2026
4 of 6 checks passed
@troyjr4103 troyjr4103 deleted the ci/registry-smoke-and-autopublish branch June 17, 2026 03:20
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