2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2018-05-27 18:19:07 -07:00
|
|
|
cd "$(dirname "$0")/.."
|
2018-05-21 23:02:54 -07:00
|
|
|
|
|
|
|
|
2018-12-11 22:38:55 -08:00
|
|
|
# List of internal crates to publish
|
|
|
|
#
|
|
|
|
# IMPORTANT: the order of the CRATES *is* significant. Crates must be published
|
|
|
|
# before the crates that depend on them. Note that this information is already
|
|
|
|
# expressed in the various Cargo.toml files, and ideally would not be duplicated
|
|
|
|
# here. (TODO: figure the crate ordering dynamically)
|
|
|
|
#
|
|
|
|
CRATES=(
|
2018-12-14 12:36:50 -08:00
|
|
|
logger
|
2018-12-14 17:14:49 -08:00
|
|
|
netutil
|
2018-12-11 22:38:55 -08:00
|
|
|
sdk
|
2018-12-12 13:30:00 -08:00
|
|
|
keygen
|
2018-12-11 22:38:55 -08:00
|
|
|
metrics
|
|
|
|
drone
|
2019-02-07 08:13:48 -08:00
|
|
|
programs/native/{budget,bpf_loader,native_loader,noop,system,vote}
|
2018-12-11 22:38:55 -08:00
|
|
|
.
|
2019-01-07 22:19:51 -08:00
|
|
|
fullnode-config
|
2018-12-12 16:59:29 -08:00
|
|
|
fullnode
|
2018-12-13 21:11:09 -08:00
|
|
|
genesis
|
|
|
|
ledger-tool
|
|
|
|
wallet
|
2019-02-07 08:44:42 -08:00
|
|
|
runtime
|
2018-12-11 22:38:55 -08:00
|
|
|
)
|
2018-05-21 23:02:54 -07:00
|
|
|
|
2018-12-11 22:38:55 -08:00
|
|
|
|
|
|
|
# Only package/publish if this is a tagged release
|
2019-01-09 09:28:19 -08:00
|
|
|
[[ -n $TRIGGERED_BUILDKITE_TAG ]] || {
|
|
|
|
echo TRIGGERED_BUILDKITE_TAG unset, skipped
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
[[ -n "$CRATES_IO_TOKEN" ]] || {
|
|
|
|
echo CRATES_IO_TOKEN undefined
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
cargoCommand="cargo publish --token $CRATES_IO_TOKEN"
|
2018-10-25 12:26:57 -07:00
|
|
|
|
2018-12-11 22:38:55 -08:00
|
|
|
for crate in "${CRATES[@]}"; do
|
|
|
|
if [[ ! -r $crate/Cargo.toml ]]; then
|
|
|
|
echo "Error: $crate/Cargo.toml does not exist"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "-- $crate"
|
2019-01-09 09:28:19 -08:00
|
|
|
# TODO: Ensure the published version matches the contents of
|
|
|
|
# TRIGGERED_BUILDKITE_TAG
|
2018-10-25 12:26:57 -07:00
|
|
|
(
|
|
|
|
set -x
|
2019-01-07 21:46:55 -08:00
|
|
|
# TODO: the rocksdb package does not build with the stock rust docker image,
|
|
|
|
# so use the solana rust docker image until this is resolved upstream
|
|
|
|
ci/docker-run.sh solanalabs/rust:1.31.0 bash -exc "cd $crate; $cargoCommand"
|
|
|
|
#ci/docker-run.sh rust bash -exc "cd $crate; $cargoCommand"
|
2018-10-25 12:26:57 -07:00
|
|
|
)
|
|
|
|
done
|
2018-05-21 23:02:54 -07:00
|
|
|
|
|
|
|
exit 0
|