language: node_js node_js: - "node" - "8" stages: - test - name: publish if: tag IS present jobs: include: - script: npm test - stage: publish node_js: "node" script: - npm run build - touch ~/.npmrc - echo "//registry.npmjs.org/:_authToken=$NPM_PUBLISH_AUTH_TOKEN" >> ~/.npmrc - npm publish