language: node_js node_js: 12 env: global: - ENABLE_ASYNC_TESTS=true stages: - test - deploy jobs: include: - stage: test script: - npm install - npm run test - stage: deploy if: (tag =~ ^v) script: - echo "//registry.npmjs.org/:_authToken=\${NPM_DEPLOY_TOKEN}" > .npmrc - npm whoami # rely on .npmrc - npm publish on: tags: true branch: main