language: node_js

env:
  global:
    - FORCE_COLOR=1

node_js:
  - "node"
  - "lts/*"

jobs:
  include:
    - stage: test
      script:
        - npm test
      after_success:
        - bash <(curl -s https://codecov.io/bash)
    - stage: release
      script:
        - npx semantic-release
      after_sucess: skip

stages:
  - test
  - name: release
    if: branch = master AND type = push AND fork = false

branches:
  except:
    - /^v\d+\.\d+\.\d+$/
