Skip to content

Commit

Permalink
update release.sh to take canary
Browse files Browse the repository at this point in the history
  • Loading branch information
bangtoven committed Nov 20, 2023
1 parent 40d9197 commit d83dba9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/wallet-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coinbase/wallet-sdk",
"version": "3.9.0-canary.5",
"version": "3.9.0",
"description": "Coinbase Wallet JavaScript SDK",
"keywords": [
"cipher",
Expand Down
28 changes: 21 additions & 7 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@ PURPLE='\033[0;35m'
TEAL='\033[0;36m'
GREEN='\033[1;32m'

isCanary=false
if [[ " $* " == *" canary "* ]]; then
echo -e "Preparing canary release..."
isCanary=true

local dir="./packages/wallet-sdk"
local packageJson="$dir/package.json"
local timestamp=$(date +%s)
local newVersion=$(jq -r '.version' "$packageJson")"-canary.$timestamp"
jq ".version = \"$newVersion\"" "$packageJson" > "$dir/temp.json" && \
mv "$dir/temp.json" "$packageJson"
echo "Canary version updated to $newVersion"
fi

gitMessage=$(git log --oneline -n 1)
mainBranch="master"
branch=$(git rev-parse --abbrev-ref HEAD)

if [ $branch == $mainBranch ]; then
echo -e "${PURPLE} Checking all branches are up-to-date..."
echo -e "================================================="
echo -e " git fetch --all"
git fetch --all
echo -e " git pull"
git pull
if [ $branch == $mainBranch ] || [$isCanary == true]; then
# echo -e "${PURPLE} Checking all branches are up-to-date..."
# echo -e "================================================="
# echo -e " git fetch --all"
# git fetch --all
# echo -e " git pull"
# git pull
echo -e "-------------------------------------------------"
echo -e "${TEAL} Build production and publish..."
echo "================================================="
Expand Down

0 comments on commit d83dba9

Please sign in to comment.