Skip to content

Commit 57f3a01

Browse files
senamakelmedullabot
andcommitted
chore(ci): add release workflow
Add a GitHub Actions workflow to automate the release process, ensuring consistent and repeatable builds for each release. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
1 parent ce7a3cb commit 57f3a01

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)