Ensure current crate versions match the tag before publishing to crates.io

This commit is contained in:
Michael Vines 2019-03-20 20:30:44 -07:00
parent 799085a105
commit b03d9884a3
1 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/.."
source ci/semver_bash/semver.sh
# List of internal crates to publish
#
@ -38,6 +38,9 @@ CRATES=(
exit 0
}
semverParseInto "$TRIGGERED_BUILDKITE_TAG" MAJOR MINOR PATCH SPECIAL
expectedCrateVersion="$MAJOR.$MINOR.$PATCH$SPECIAL"
[[ -n "$CRATES_IO_TOKEN" ]] || {
echo CRATES_IO_TOKEN undefined
exit 1
@ -51,8 +54,11 @@ for crate in "${CRATES[@]}"; do
exit 1
fi
echo "-- $crate"
# TODO: Ensure the published version matches the contents of
# TRIGGERED_BUILDKITE_TAG
grep -q "^version = \"$expectedCrateVersion\"$" Cargo.toml || {
echo "Error: $crate/Cargo.toml version is not $expectedCrateVersion"
exit 1
}
(
set -x
# TODO: the rocksdb package does not build with the stock rust docker image,