-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.sh
executable file
·56 lines (47 loc) · 1.08 KB
/
publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
MODULES_DIR='./modules'
TYPE=$1
# set the script to exit in case of errors
set -o errexit
# check the version bump type
if [ "${TYPE}" != "major" ] && [ "${TYPE}" != "minor" ] && [ "${TYPE}" != "patch" ]
then
echo "Version bump type: major|minor|patch"
exit -1
fi
# generate docs
cd generateDocs
node index
cd ..
# lint the modules
for MODULE in ${MODULES_DIR}/*/;
do
ng lint $(basename ${MODULE}) --fix
done
# build the modules (for production)
for MODULE in ${MODULES_DIR}/*/;
do
ng build $(basename ${MODULE}) --configuration production
done
# bump the module's versions
for MODULE in ${MODULES_DIR}/*/;
do
echo "Bumping to new ${TYPE} version $(basename ${MODULE})..."
# source
cd ${MODULE}
npm version ${TYPE} --git-tag-version=false
cd ../../
# dist
cd dist/$(basename ${MODULE})
npm version ${TYPE} --git-tag-version=false
cd ../../
done
# publish the new versions
for MODULE in ${MODULES_DIR}/*/;
do
cd dist/$(basename ${MODULE})
npm publish --access public
cd ../../
done
# bump version of main package
npm version ${TYPE} --git-tag-version=false