Skip to content

Commit 06322c7

Browse files
committed
ci: pin internal dep versions to exact pre-release version in release workflow
When the workspace version is a pre-release (e.g. 0.0.0-beta.3), semver "0" ranges fail to match, so update internal crate requirements to the exact version (=X.Y.Z-pre) before publishing.
1 parent 9d9440a commit 06322c7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ jobs:
217217
| jq -r '.packages[] | select(.name == "nodedb-types") | .version')
218218
if [[ "$VERSION" != "$CURRENT" ]]; then
219219
perl -i -pe "if (!\$done && /^version = \"/) { s/^version = \".*\"/version = \"$VERSION\"/; \$done=1 }" Cargo.toml
220+
221+
# For pre-release versions, pin internal dep requirements so semver
222+
# "0" doesn't fail to match "0.0.0-beta.3"
223+
if [[ "$VERSION" == *-* ]]; then
224+
sed -i -E 's/(nodedb-(codec|bridge|wal|mem|crdt|raft|fts|types|vector|graph|spatial|strict|client|columnar|cluster|query|sql) = \{ [^}]*version = )"[^"]*"/\1"='"$VERSION"'"/' Cargo.toml
225+
echo "Updated internal dep versions to =$VERSION"
226+
fi
227+
220228
echo "Updated workspace version: $CURRENT -> $VERSION"
221229
fi
222230

0 commit comments

Comments
 (0)