diff --git a/ps_spec.yml b/ps_spec.yml new file mode 100644 index 0000000..b3a3462 --- /dev/null +++ b/ps_spec.yml @@ -0,0 +1,42 @@ +version: 1.0 +service_name: aims-client + +stages: + - + name: PR Test + when: + - pull_request + image: node:13 + compute_size: small + commands: + - npm install +# - npm install puppeteer +# - export CHROME_BIN=$(node -e "console.log(require('puppeteer').executablePath())") +# - npm run test + - npm run lint + - npm run build + - npx madge --circular --extensions ts --ts-config tsconfig.json src + + - + name: Master Push - Publish + when: + - push: ['master'] + image: node:13 + compute_size: small + commands: + - npm install + - echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > .npmrc + - npm whoami + - | + set -ex + PKGNAME=$(node -e 'console.log(require("./package.json").name)') + PKGVERSION=$(node -e 'console.log(require("./package.json").version)') + WORDCOUNT=$(npm view "${PKGNAME}@${PKGVERSION}" | wc -c) + if [ "$WORDCOUNT" -eq 0 ]; then + echo "PUBLISHING $PKGNAME $PKGVERSION" + npm run build + npm publish --access public + else + echo "NOT PUBLISHING $PKGNAME $PKGVERSION" + fi + - echo done