botbuilder-tools/build.ci.sh

67 строки
1.5 KiB
Bash
Исходник Обычный вид История

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
npm run coveralls
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
}
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/
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
npm config set registry $oldregistry
}
function publish() {
echo Publish $1
2018-08-22 21:01:13 +03:00
pushd packages
pushd $1
create_npmrc
update_version
npm publish
popd
2018-08-22 21:01:13 +03:00
popd
}
2018-08-15 21:38:27 +03:00
main "$@"