Skip to content

Commit

Permalink
Merge pull request #17 from IBM/BuildBeforePublish
Browse files Browse the repository at this point in the history
Build before publish
  • Loading branch information
gabe-l-hart authored Aug 5, 2021
2 parents a0e0155 + 951724d commit 5bd8fe4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ts/ci/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ fi
version_placeholder="0.0.0-REPLACEME"
if [[ "$OSTYPE" == "darwin"* ]]
then
sed_cmd="sed -i ''"
sed_cmd="sed -i .bak"
else
sed_cmd="sed -i''"
sed_cmd="sed -i.bak"
fi
$sed_cmd "s,$version_placeholder,$TS_RELEASE_VERSION,g" package.json
rm package.json.bak

# If this is a dry run, add the flag
dry_run_flag=""
Expand All @@ -32,9 +33,13 @@ then
dry_run_flag="--dry-run"
fi

# Run the build
npm run build

# Run publish
npm whoami
npm publish $dry_run_flag

# Replace the placeholder
$sed_cmd "s,$TS_RELEASE_VERSION,$version_placeholder,g" package.json
rm package.json.bak

0 comments on commit 5bd8fe4

Please sign in to comment.