Skip to content

ci(release): skip crates.io package/publish while crates are unpublishable - #20

Merged
senamakel merged 5 commits into
mainfrom
fix-release-2026-08-30
Aug 30, 2026
Merged

ci(release): skip crates.io package/publish while crates are unpublishable#20
senamakel merged 5 commits into
mainfrom
fix-release-2026-08-30

Conversation

@senamakel

@senamakel senamakel commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

Run 33327827434 (release workflow, bump=patch on main) failed in job Release Rust Crate, step Publish to crates.io:

Uploading tinychannels-bus v0.1.1 (...)
error: failed to publish tinychannels-bus v0.1.1 to registry at https://crates.io

Caused by:
  please provide a non-empty token

Root cause (updated): this PR originally treated the missing CARGO_REGISTRY_TOKEN secret as something to provision and fail fast on. That's wrong — tinychannels crates aren't actually meant to be published to crates.io. Every consumer of tinychannels / tinychannels-bus points at this repo via GitHub (a git dependency or a vendored submodule), not the registry, so there is no CARGO_REGISTRY_TOKEN to add and no reason for the release workflow to ever attempt cargo publish here.

Fix

Instead of failing fast on a missing token, the release workflow now skips crates.io packaging/publishing cleanly while still doing the useful release work:

  • Marked tinychannels (root) and tinychannels-bus (contract crate) as publish = false in their Cargo.tomls — the most honest expression of "this crate is not published to crates.io". tinychannels-module already carried publish = false. Checked that nothing else in the workspace depends on these crates being registry-publishable (no other workflow, dry-run, or tooling references cargo publish/cargo package outside release.yml).
  • Added a Check crates.io publishability step that reads the resolved publish field via cargo metadata --no-deps --format-version 1 | jq, and gates the Package the bus contract and Publish to crates.io steps on it (if: steps.publishable.outputs.publishable == 'true'). When skipping, it emits ::notice:: instead of failing.
  • The version-bump/commit/tag/push steps, the module bundle builds, and the GitHub release/asset-upload jobs remain unconditional — a release still computes the next version, bumps it, commits, tags, pushes, builds the per-platform module bundles, and creates the GitHub release with assets. Only the crates.io packaging/publishing is skipped.
  • Removed the old fail-fast preflight step (Verify crates.io token is configured) — there is no token to verify.

This mirrors the pattern the sibling repo tinycortex already merged for the same situation (tinyhumansai/tinycortex#160): gate cargo package/cargo publish on the resolved publish field, ::notice:: on skip, keep everything else unconditional.

No CARGO_REGISTRY_TOKEN secret needs to be provisioned — crates.io publishing is intentionally unused for this repo.

Test plan

  • Validated the workflow YAML parses (python3 -c "import yaml; yaml.safe_load(open('.github/workflows/release.yml'))")
  • Verified cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name=="tinychannels") | .publish' resolves to [] (unpublishable) and confirmed the gating shell logic takes the skip path against that output
  • Run the release workflow with bump=patch on main and confirm it bumps/commits/tags/pushes, builds and uploads module bundles, creates the GitHub release, and skips the crates.io package/publish steps with a ::notice::

Ref: run https://github.com/tinyhumansai/tinychannels/actions/runs/33327827434

The 'Production' environment for this repo has no CARGO_REGISTRY_TOKEN
secret configured, so 'cargo publish' failed with 'please provide a
non-empty token' after the version bump/tag/commit/push had already
landed on main (see run 33327827434). Add a preflight check right
after checkout so a missing token is caught before any state is
mutated, instead of after a version number and tag are already burned.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-30T18:44:08.091319Z 8d0e630 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

$0.0000 · 0 in / 0 out

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Aug 30, 2026
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7b3f497a-765a-4179-a430-aa2cdff0db8d

📥 Commits

Reviewing files that changed from the base of the PR and between b4d5ee7 and e1de5ab.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The release workflow now checks CARGO_REGISTRY_TOKEN in the Production environment before version bumps, commits, tags, or publishing.

Changes

Release validation

Layer / File(s) Summary
Registry token preflight
.github/workflows/release.yml
The workflow reports an error and exits when CARGO_REGISTRY_TOKEN is empty or unset. The check runs before repository mutations and publishing.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to e1de5

The workflow now checks for the registry token before making release changes, preventing a missing-token run from creating an unreleased version. No actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit checks the token tight
Before tags take their flight
Empty secrets halt the race
Safe releases keep their place
The crate hops forth just right

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title refers to release publishing, but it incorrectly states that the workflow skips publishing because crates are unpublishable. The actual change adds a preflight failure when CARGO_REGISTRY_TO… Rename the title to describe the credential preflight check, for example: "ci(release): fail early when CARGO_REGISTRY_TOKEN is missing".
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Full details: Title check

Explanation

The title refers to release publishing, but it incorrectly states that the workflow skips publishing because crates are unpublishable. The actual change adds a preflight failure when CARGO_REGISTRY_TOKEN is missing.

  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

senamakel and others added 4 commits August 30, 2026 21:40
Consumers depend on this crate via GitHub as a git dependency or vendored submodule rather than crates.io, so there is nothing to publish. This change adds `publish = false` to the manifest to prevent accidental publication.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
This change introduces the Cargo.toml file for the tinychannels-bus crate, establishing its metadata and dependencies as part of the project structure.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a GitHub Actions workflow to automate the release process, ensuring consistent and repeatable releases directly from the repository.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The release workflow has been updated to use the latest versions of GitHub Actions, ensuring compatibility and access to recent features and security patches.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel senamakel changed the title ci(release): fail fast when CARGO_REGISTRY_TOKEN is missing ci(release): skip crates.io package/publish while crates are unpublishable Aug 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d0e630ee5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +157 to +159
if [[ "$publish" == "[]" ]]; then
echo "publishable=false" >> "$GITHUB_OUTPUT"
echo "::notice::${CRATE_NAME} has publish = false; skipping crates.io package/publish steps."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Do not silently skip publishing both Rust crates

On every release run, the new publish = false flags make this comparison succeed, so the conditions on the package and publish steps skip both crates while the workflow still pushes the release commit and tag. The job therefore reports success and consumes a version without publishing tinychannels-bus or tinychannels to crates.io, contrary to the existing release flow and README dependency instructions; keep these crates publishable and validate the registry token before creating the release commit instead. The repository structure identifies only tinychannels-module as the private, unpublishable artifact crate.

AGENTS.md reference: AGENTS.md:L8-L12

Useful? React with 👍 / 👎.

@senamakel
senamakel merged commit 6511806 into main Aug 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant