language: node_js
node_js: '10'

os:
  - linux
  - osx
  - windows

script:
  # - npm run lint
  - echo "npm run check"
  - echo "npm run cover"
  - echo "npm run build"
  - echo "npm run bundle:$TRAVIS_OS_NAME"

after_success:
  # Upload test coverage to codecov.io
  - echo "bash <(curl -s https://codecov.io/bash)"

deploy:
  # Do a semantic release (only on Linux to avoid duplication)
  - provider: script
    skip_cleanup: true
    script: npx semantic-release
    on:
      branch: master
      condition: $TRAVIS_OS_NAME = linux

  # Deploy build artifacts to Github release
  # page on *any* tag (including those generated for a semantic release)
  - provider: releases
    api_key: $GITHUB_TOKEN
    file_glob: true
    file: bin/*.tar.gz
    skip_cleanup: true
    on:
      tags: true

language: node_js
node_js: '10'

os:
  - linux
  - osx

  # Windows builds fail on Travis for projects with secrets
  # See https://travis-ci.community/t/current-known-issues-please-read-this-before-posting-a-new-topic/264/10
  # - windows

script:
  # - npm run lint
  - echo "npm run check"
  - echo "npm run cover"
  - echo "npm run build"
  - echo "npm run bundle:$TRAVIS_OS_NAME"

after_success:
  # Upload test coverage to codecov.io
  - echo "bash <(curl -s https://codecov.io/bash)"

deploy:
  # Do a semantic release (only on Linux to avoid duplication)
  - provider: script
    skip_cleanup: true
    script: npx semantic-release
    on:
      branch: master
      condition: $TRAVIS_OS_NAME = linux

  # Deploy build artifacts to Github release
  # page on *any* tag (including those generated for a semantic release)
  - provider: releases
    api_key: $GITHUB_TOKEN
    file_glob: true
    file: bin/*.tar.gz
    skip_cleanup: true
    on:
      tags: true

Remove Windows from Travis build matrix
ci: Remove Windows from Travis build matrix
