Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,34 @@ jobs:
git commit -m "Release ${RELEASE_TAG}"
git tag -a "${RELEASE_TAG}" -m "Release ${RELEASE_TAG}"

# Consumers point at this repo via GitHub (git dependency / vendored
# submodule) rather than crates.io, so both `tinychannels` and its
# contract crate `tinychannels-bus` carry `publish = false`. Packaging or
# publishing either always fails against that, so skip both steps
# instead of hard-failing the whole release (which also blocks the
# version-bump tag from ever being pushed). Checking the root crate's
# `publish` field is enough: both crates are set the same way and are
# meant to move together.
- name: Check crates.io publishability
id: publishable
run: |
set -euo pipefail

publish="$(cargo metadata --no-deps --format-version 1 | jq -r --arg crate "$CRATE_NAME" '.packages[] | select(.name == $crate) | .publish')"
if [[ "$publish" == "[]" ]]; then
echo "publishable=false" >> "$GITHUB_OUTPUT"
echo "::notice::${CRATE_NAME} has publish = false; skipping crates.io package/publish steps."
Comment on lines +157 to +159

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 👍 / 👎.

else
echo "publishable=true" >> "$GITHUB_OUTPUT"
fi

# Only the contract crate can be packaged here. `cargo package` rewrites a
# path dependency to a registry lookup, so packaging the root crate fails
# until `tinychannels-bus` is actually in the index — which happens in the
# publish step below. `tinychannels-module` is `publish = false` and is
# skipped entirely.
- name: Package the bus contract
if: steps.publishable.outputs.publishable == 'true'
run: cargo package --locked --package tinychannels-bus

- name: Push release commit and tag
Expand All @@ -167,6 +189,7 @@ jobs:
# version is treated as success so a retry after a partial failure is not
# itself fatal.
- name: Publish to crates.io
if: steps.publishable.outputs.publishable == 'true'
run: |
set -euo pipefail

Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ repository = "https://github.com/tinyhumansai/tinychannels"
readme = "README.md"
keywords = ["messaging", "channels", "openhuman", "harness"]
categories = ["asynchronous", "api-bindings"]
# Consumers depend on this crate via GitHub (git dependency / vendored
# submodule), not crates.io, so there is nothing to publish. See the
# equivalent note in crates/tinychannels-bus/Cargo.toml.
publish = false

[features]
default = []
Expand Down
5 changes: 5 additions & 0 deletions crates/tinychannels-bus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ repository = "https://github.com/tinyhumansai/tinychannels"
readme = "README.md"
keywords = ["messaging", "channels", "tinybus", "openhuman"]
categories = ["data-structures", "api-bindings"]
# Consumers depend on this crate via GitHub (git dependency / vendored
# submodule), not crates.io, so there is nothing to publish. This is the
# contract crate the root `tinychannels` crate above pins by version; keeping
# both `publish = false` keeps the story consistent end to end.
publish = false

[dependencies]
# Every payload that crosses the boundary is a typed Serde value.
Expand Down