2018-08-15 21:38:27 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
main() {
|
2018-09-17 19:36:43 +03:00
|
|
|
if [[ "${TRAVIS_EVENT_TYPE}" = "cron" ]] || [[ $1 = "publish" ]]; then
|
2018-09-04 22:34:08 +03:00
|
|
|
npm install
|
|
|
|
npm run build
|
2018-08-15 21:38:27 +03:00
|
|
|
publish Chatdown
|
|
|
|
publish Dispatch
|
|
|
|
publish Ludown
|
|
|
|
publish LUIS
|
|
|
|
publish LUISGen
|
|
|
|
publish MSBot
|
|
|
|
publish QnAMaker
|
|
|
|
else
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
npm install
|
2018-10-02 07:56:56 +03:00
|
|
|
npm install -g typescript
|
|
|
|
cd packages/LUISGen/tests/LUISGenTestJS/
|
|
|
|
npm install
|
|
|
|
cd ../../../../
|
2018-08-15 21:38:27 +03:00
|
|
|
npm run build
|
2018-09-06 19:30:09 +03:00
|
|
|
npm run coveralls
|
2018-09-12 22:50:49 +03:00
|
|
|
npm run tslint
|
|
|
|
npm run eslint
|
2018-08-15 21:38:27 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
fi
|
|
|
|
errorcode=$?
|
|
|
|
|
|
|
|
if [ $errorcode -ne 0 ]; then
|
|
|
|
echo exiting with errorcode $errorcode
|
|
|
|
exit $errorcode
|
|
|
|
fi
|
2018-08-01 14:54:22 +03:00
|
|
|
}
|
|
|
|
|
2018-07-27 20:47:00 +03:00
|
|
|
function create_npmrc() {
|
|
|
|
cat > .npmrc << EOF
|
|
|
|
registry=https:\${NPM_REGISTRY}
|
|
|
|
\${NPM_REGISTRY}:_authToken=\${NPM_TOKEN}
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
function update_version() {
|
2018-09-29 04:12:15 +03:00
|
|
|
oldregistry=$(npm config get registry)
|
2018-09-23 08:29:10 +03:00
|
|
|
npm config set registry https://botbuilder.myget.org/F/botbuilder-tools-daily/npm/
|
2018-09-17 19:22:20 +03:00
|
|
|
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
|
2018-09-23 08:29:10 +03:00
|
|
|
npm config set registry $oldregistry
|
2018-07-27 20:47:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function publish() {
|
|
|
|
echo Publish $1
|
2018-08-22 21:01:13 +03:00
|
|
|
pushd packages
|
2018-07-27 20:47:00 +03:00
|
|
|
pushd $1
|
|
|
|
create_npmrc
|
|
|
|
update_version
|
|
|
|
npm publish
|
|
|
|
popd
|
2018-08-22 21:01:13 +03:00
|
|
|
popd
|
2018-07-27 20:47:00 +03:00
|
|
|
}
|
|
|
|
|
2018-08-15 21:38:27 +03:00
|
|
|
main "$@"
|