forked from microsoft/botbuilder-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ci.sh
66 lines (59 loc) · 1.48 KB
/
build.ci.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
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
main() {
if [[ "${TRAVIS_EVENT_TYPE}" = "cron" ]] || [[ $1 = "publish" ]]; then
npm install
npm run build
publish Chatdown
publish Dispatch
publish Ludown
publish LUIS
publish LUISGen
publish MSBot
publish QnAMaker
else
(
set -e
npm install
npm install -g typescript
cd packages/LUISGen/tests/LUISGenTestJS/
npm install
cd ../../../../
npm run build
npm run coveralls
npm run tslint
npm run eslint
)
fi
errorcode=$?
if [ $errorcode -ne 0 ]; then
echo exiting with errorcode $errorcode
exit $errorcode
fi
}
function create_npmrc() {
cat > .npmrc << EOF
registry=https:\${NPM_REGISTRY}
\${NPM_REGISTRY}:_authToken=\${NPM_TOKEN}
EOF
}
function update_version() {
oldregistry=$(npm config get registry)
npm config set registry https://botbuilder.myget.org/F/botbuilder-tools-daily/npm/
pname=$(cat package.json | jq -r '.name' | cut -d- -f1)
pversion=$(cat package.json | jq -r '.version' | cut -d- -f1)
ppatch=$(npm view $pname version | cut -d- -f2 | rev | cut -d. -f1 | rev)
npm version --allow-same-version $pversion-$ppatch
npm version prerelease
npm config set registry $oldregistry
}
function publish() {
echo Publish $1
pushd packages
pushd $1
create_npmrc
update_version
npm publish
popd
popd
}
main "$@"