2018-05-21 23:02:54 -07:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
|
|
|
if [[ -z "$BUILDKITE_TAG" ]]; then
|
|
|
|
# Skip publish if this is not a tagged release
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2018-05-25 15:08:14 -07:00
|
|
|
if [[ -z "$CRATES_IO_TOKEN" ]]; then
|
2018-05-21 23:02:54 -07:00
|
|
|
echo CRATES_IO_TOKEN undefined
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cargo package
|
|
|
|
# TODO: Ensure the published version matches the contents of BUILDKITE_TAG
|
|
|
|
cargo publish --token "$CRATES_IO_TOKEN"
|
|
|
|
|
|
|
|
exit 0
|