File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed
Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ RELEASE_VERSION=$1
6+ VERSION_TYPE=$2
7+
8+ if [[ -z " $RELEASE_VERSION " || -z " $VERSION_TYPE " ]]; then
9+ echo " Error: Missing version number or version type."
10+ echo " Usage: npm run deploy -- <version> <major|minor|patch>"
11+ exit 1
12+ fi
13+
14+ git checkout master
15+
16+ echo " Pulling latest changes from master branch..."
17+ git pull
18+
19+ echo " Running lint checks..."
20+ npm run lint
21+
22+ echo " Running unit tests..."
23+ npm test
24+
25+ echo " Building project..."
26+ npm run build
27+
28+ git status --short
29+
30+ echo " Do you want to proceed with staging these files? (yes/no)"
31+ read CONFIRMATION
32+
33+ if [[ " $CONFIRMATION " == " yes" ]]; then
34+ echo " Staging changes..."
35+ git add .
36+
37+ git commit -m " Bundle release $RELEASE_VERSION "
38+
39+ echo " Bumping version..."
40+ npm version $VERSION_TYPE
41+
42+ echo " Publishing to npm..."
43+ npm publish --access public
44+
45+ echo " Pushing changes to repository..."
46+ git push --tags origin master
47+
48+ echo " Deployment complete!"
49+ else
50+ echo " Staging aborted. No changes committed. Deployment aborted."
51+ fi
Original file line number Diff line number Diff line change 3636 "build" : " rollup -c" ,
3737 "watch" : " rollup -c --watch" ,
3838 "postbuild" : " node bundle_size.js" ,
39+ "deploy" : " bash deployment-scripts/deploy-release.sh" ,
3940 "lint" : " eslint ." ,
4041 "precommit" : " eslint . --max-warnings 0 && pretty-quick --staged" ,
4142 "test" : " jest"
You can’t perform that action at this time.
0 commit comments