diff --git a/release.sh b/release.sh index 79803055f..144b3bc19 100755 --- a/release.sh +++ b/release.sh @@ -1,10 +1,34 @@ #!/usr/bin/env bash -# Exit script as soon as a command fails. -set -o errexit +POSITIONAL_ARGS=() + +while [[ $# -gt 0 ]]; do + case $1 in + --local) + local=1 + shift # past argument + ;; + --no-build) + skip_build=1 + shift # past argument + ;; + -*|--*) + echo "Unknown option $1" + exit 1 + ;; + *) + POSITIONAL_ARGS+=("$1") # save positional arg + shift # past argument + ;; + esac +done + +set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters echo "### Release script started..." +if [[ $skip_build -eq 0 ]]; then yarn build +fi echo "### Build finished. Copying abis." rm -rf contracts/abi mkdir -p contracts/abi @@ -18,7 +42,11 @@ cp README.md contracts/README.md # publish from contracts folder cd contracts echo "### Publishing..." +if [[ $local -eq 1 ]]; then +yalc push +else np --any-branch --no-tests +fi # delete copied README rm README.md # back to root folder