Skip to content

Commit

Permalink
Add --dry-run option to runtime/publish.sh script
Browse files Browse the repository at this point in the history
The `--dry-run` flag will allow to run `runtime/publish.sh` script to
test whether all the crates are in a state where they can be published.
Note that at the moment, this check fails due to problems described in
the GitHub Issue.

Issue: near#4379
  • Loading branch information
mina86 committed Jun 22, 2021
1 parent 65bd8ca commit 3c85d4e
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions runtime/publish.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
#!/usr/bin/env bash
set -ex
for p in near-runtime-utils near-vm-errors near-vm-logic near-vm-runner near-vm-runner-standalone
do
pushd ./${p}
cargo publish
popd
# Sleep a bit to let the previous package upload to crates.io. Otherwise we fail publishing checks.
sleep 30

set -eu

dry_run_arg=
if [ "$#" -ge 1 ]; then
case "${1-}" in
--dry-run)
dry_run_arg=--dry-run
;;
*)
echo "${0##*/}: $1: unknown argument" >&2
exit 1
;;
esac
fi

pwd=$(pwd)

set -x

for pkg in near-runtime-utils near-vm-errors near-vm-logic near-vm-runner \
near-vm-runner-standalone; do
cd "$pwd/$pkg"
cargo publish $dry_run_arg
if [ -z "$dry_run_arg" ]; then
# Sleep a bit to let the previous package upload to
# crates.io. Otherwise we fail publishing checks.
sleep 30
fi
done

0 comments on commit 3c85d4e

Please sign in to comment.