Skip to content

Commit

Permalink
feat(pre-publish script): Add pre-publish shell script to support sta…
Browse files Browse the repository at this point in the history
…ndard-version prerelease (#57)

* Add script for pre-publish

Add prerelease for standard-version

* Update

* Remove extra changes

* Update script

Skip changelog when not in master
Add -e flash to bash
Move commands to run tests out of script

* Revert version
  • Loading branch information
iamgarima authored Dec 10, 2018
1 parent e29f603 commit b6ba360
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 32 deletions.
15 changes: 15 additions & 0 deletions bin-dev-scripts/standard-version-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -e

npm install
git diff --quiet

BRANCH=$(git symbolic-ref --short HEAD)

if [ "$BRANCH" == 'master' ]
then
npx standard-version
else
npx standard-version --prerelease "$BRANCH" --skip.changelog=true
fi

git push --follow-tags origin "$BRANCH"
62 changes: 31 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Libraries to help build Quintype Node.js apps",
"main": "index.js",
"scripts": {
"prepublishOnly": "npm install && npm test && git diff --quiet && npx standard-version && git push --follow-tags origin",
"prepublishOnly": "npm test && ./bin-dev-scripts/standard-version-release.sh",
"test": "NODE_ENV=test npx mocha --recursive --require ./test/babel",
"watch-test": "NODE_ENV=test npx mocha --recursive --watch --require ./test/babel",
"coverage": "nyc --all npm test",
Expand Down

0 comments on commit b6ba360

Please sign in to comment.