Skip to content

Commit

Permalink
allow for --local and --no-build for release.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquim-verges committed May 12, 2022
1 parent e3ceb05 commit 8452bd4
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8452bd4

Please sign in to comment.