language: python
env:
  - VERSION=${TRAVIS_TAG:-vdev}
install:
  - pip install -U platformio
script:
  - export PLATFORMIO_BUILD_FLAGS="-D'VERSION=\"${VERSION}\"'"
  - pio run -e release
  - mv .pio/build/release/firmware.bin twr-skeleton-${VERSION}.bin
  - ls -lha
deploy:
  skip_cleanup: true
  file_glob: true
  file: ./*.bin
  api_key: ${GITHUB_KEY}
  provider: releases
  overwrite: true
  on:
    tags: true
