1
1
set -e
2
2
3
- # check if np is installed
4
- np_version=$( np --version)
5
- echo " Using np:" $np_version
3
+ CURRENT_BRANCH=$( git branch --show-current)
4
+ if [ $CURRENT_BRANCH != " master" ]; then
5
+ echo " This script can only be run in the master branch. Exiting..."
6
+ exit 1
7
+ fi
6
8
7
9
# get the version number from the user
8
10
read -e -p " Enter the new Vue Native version: " VERSION
@@ -49,19 +51,18 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
49
51
git add -A
50
52
git commit -m " [build] $VERSION "
51
53
52
- # use np to create release with VERSION and publish vue-native-core
53
- # you MUST be in the master branch to do this
54
- # if it fails, then the last commit is reset and the script exits
55
- # TODO: add tests and remove --yolo
56
- np --no-yarn --contents packages/vue-native-core --yolo $VERSION || { git reset --soft HEAD~1; exit 1; }
57
-
58
54
# publish packages
59
55
# vue-native-core has already been published by np
60
56
# packages:
57
+ # - vue-native-core
61
58
# - vue-native-helper
62
59
# - vue-native-scripts
63
60
# - vue-native-template-compiler
64
61
62
+ cd packages/vue-native-core
63
+ npm publish
64
+ cd -
65
+
65
66
cd packages/vue-native-helper
66
67
npm publish
67
68
cd -
@@ -74,4 +75,12 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
74
75
npm publish
75
76
cd -
76
77
78
+ # Update version in main package.json and commit
79
+ npm version $VERSION
80
+
81
+ # Push the tags and version update
82
+ git push origin v$VERSION
83
+ git push origin master
84
+
85
+ echo " \nPublished v$VERSION !"
77
86
fi
0 commit comments