language: node_js
node_js:
  - '10'
  - '12'
  - '13'

jobs:
  include:
    - stage: npm release
      if: tag IS present
      node_js: '12'
      script: echo "Deploying to npm ..."
      deploy:
        provider: npm
        email: '$NPM_EMAIL'
        api_key: '$NPM_TOKEN'
        on:
          tags: true
        edge: true
    - stage: GitHub Release
      if: tag IS present
      node_js: '12'
      script: echo "Deploying to GitHub releases ..."
      deploy:
        provider: releases
        api_key: $GITHUB_OAUTH_TOKEN
        cleanup: true
        name: $TRAVIS_TAG
        on:
          tags: true
        edge: true
        prerelease: true
