Skip to content

Commit

Permalink
Adjusted release script to be more robust and correclty run publish c…
Browse files Browse the repository at this point in the history
…ommands in dry mode
  • Loading branch information
maoueh committed May 30, 2022
1 parent 6a986f2 commit a9384e3
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"

dry_run=""
force="false"
tag=""

main() {
pushd "$ROOT" &> /dev/null
Expand Down Expand Up @@ -58,19 +59,28 @@ main() {
fi

git tag "$version"
tag="$version"

# Remove auto-failure as we handle the errors ourself
set +e
if [[ "$force" == "false" ]]; then
trap cleanup_tag EXIT
fi

goreleaser release $args
if [[ $? -gt 0 || "$force" == "false" ]]; then
git tag -d "$version"
exit 1

args="${CARGO_PUBISH_ARGS:-}"
if [[ "$force" == "false" ]]; then
args="--dry-run $args"
fi

# We need to publish one crate at a time, one after the one
cargo publish --target wasm32-unknown-unknown -p substreams-macro
cargo publish --target wasm32-unknown-unknown -p substreams
cargo publish $args --target wasm32-unknown-unknown -p substreams-macro
cargo publish $args --target wasm32-unknown-unknown -p substreams
}

cleanup_tag() {
if [[ "$tag" != "" ]]; then
git tag -d "$tag"
fi
}

verify_github_token() {
Expand Down

0 comments on commit a9384e3

Please sign in to comment.