diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f676b2c..5f418a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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." + 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 @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 1a4ccbd..304a880 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 = [] diff --git a/crates/tinychannels-bus/Cargo.toml b/crates/tinychannels-bus/Cargo.toml index 90fa6b6..2d2df39 100644 --- a/crates/tinychannels-bus/Cargo.toml +++ b/crates/tinychannels-bus/Cargo.toml @@ -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.