ci: registry-only smoke + idempotent auto-publish on main#2
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tomlpatches deps to sibling checkouts) can no longer reach main undetected.Adds
.github/workflows/registry-publish.ymland a publish script.registry_smoke— safety net (runs on PRs + main).cargo/config.tomlto contain ONLY the[registries.kin]alias (sparse+https://kinlab.ai/registry/cargo/), stripping the[patch.kin]redirects for kin-blobs / kin-vector.cargo buildagainst 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)scripts/publish-kinlab-crates.sh.registry_smokepasses.New publish script — version-from-Cargo.toml
scripts/publish-kinlab-crates.shis modeled on kin-db's (cargo package+ POST to/registry/cargo/api/v1/crates/publishwithauthorization: Bearer). It derives the version fromcargo metadata(Cargo.toml), so a version-bump merge auto-publishes without a git tag.TAG_NAME/ a tag-typedGITHUB_REF_NAMEis 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) andKINLAB_CARGO_REGISTRY_URL(var) provisioned before the publish job can run. I did not set these.Validation
bash -n scripts/publish-kinlab-crates.shpasses.registry-publish.ymlparses (yaml.safe_load).0.2.0from Cargo.toml with no tag.No
cargo publish/ registry POST was run; no secrets were modified.