Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Commit

Permalink
feat: npm release script (#984)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliodialpad authored and yorbi-dp committed Oct 23, 2023
1 parent 4d1d7e7 commit 7c06a86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"lint:library": "run-s stylelint lesshint",
"prepare": "husky install",
"prepublishOnly": "npm run build",
"release": "semantic-release --no-ci --extends ./release-local.config.js",
"release": "./scripts/release.sh",
"start": "gulp watch",
"stylelint": "npx stylelint 'lib/build/less/**/*.less' 'docs/.vuepress/theme/**/*.{less,css}'",
"build:icons": "gulp icons",
Expand Down
15 changes: 15 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e

branch="$(git rev-parse --abbrev-ref HEAD)"

if ! [[ "$branch" =~ ^staging$ ]]; then
echo "This script can only be run while on staging branch"
exit 1;
fi

git pull &&
npx semantic-release --no-ci --extends ./release-local.config.js &&
git checkout production &&
git merge --ff-only staging &&
git push -u origin production

0 comments on commit 7c06a86

Please sign in to comment.