File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,12 +127,36 @@ jobs:
127127 echo "tag=${tag}"
128128 } >> "$GITHUB_OUTPUT"
129129
130+ # Bumps the root `[package]` version only. That is sufficient *because* no
131+ # intra-workspace path dependency carries a `version = "…"` requirement —
132+ # a `minor` bump to 0.2.0 against a sibling asking for `^0.1.0` fails
133+ # resolution here with "failed to select a version", which is exactly how
134+ # the first attempt at this release died. Those requirements only ever
135+ # existed to satisfy crates.io publishing, which this repo does not do.
136+ #
137+ # So: do not add `version` back to a `tinymemory*` path dependency. The
138+ # guard below fails with that explanation rather than cargo's, which does
139+ # not mention the cause.
130140 - name : Update crate version
131141 env :
132142 CRATE_NAME : ${{ steps.version.outputs.crate_name }}
133143 NEXT_VERSION : ${{ steps.version.outputs.next_version }}
134144 run : |
135145 set -euo pipefail
146+
147+ offenders="$(
148+ grep -rn --include=Cargo.toml -E \
149+ '^tinymemory(-api|-core|-tinycortex)? *= *\{[^}]*version *=' . || true
150+ )"
151+ if [[ -n "$offenders" ]]; then
152+ echo "An intra-workspace path dependency carries a version requirement:" >&2
153+ echo "$offenders" >&2
154+ echo >&2
155+ echo "Bumping the root package will fail to resolve against it. Nothing here" >&2
156+ echo "is published to crates.io, so drop the 'version' key and keep 'path'." >&2
157+ exit 1
158+ fi
159+
136160 perl -0pi -e 's/(\[package\][\s\S]*?\nversion = ")[^"]+(")/$1$ENV{NEXT_VERSION}$2/' Cargo.toml
137161 cargo update -p "$CRATE_NAME" --precise "$NEXT_VERSION"
138162
You can’t perform that action at this time.
0 commit comments