diff --git a/.rosie.yml b/.rosie.yml index d0e9fe2e26..7fee7e960e 100644 --- a/.rosie.yml +++ b/.rosie.yml @@ -2,8 +2,11 @@ # builds them) and where to find the tests. binaries: - prebuilt_s3: adafruit-circuit-python - file_pattern: bin/{board}/adafruit-circuitpython-{board}-*-{short_sha}.{extension} + prebuilt_s3: + bucket: adafruit-circuit-python + file_pattern: bin/{board}/adafruit-circuitpython-{board}-*-{short_sha}.{extension} + rosie_upload: + file_pattern: adafruit-circuitpython-{board}-{short_sha}.{extension} circuitpython_tests: test_directories: diff --git a/tools/build_adafruit_bins.sh b/tools/build_adafruit_bins.sh index 25ca6a3ee7..29747fde9f 100755 --- a/tools/build_adafruit_bins.sh +++ b/tools/build_adafruit_bins.sh @@ -2,6 +2,7 @@ rm -rf atmel-samd/build* rm -rf esp8266/build* ATMEL_BOARDS="arduino_zero circuitplayground_express feather_m0_basic feather_m0_adalogger feather_m0_express metro_m0_express trinket_m0 gemma_m0" +ROSIE_SETUPS="rosie-ci" for board in $ATMEL_BOARDS; do make -C atmel-samd BOARD=$board @@ -17,12 +18,23 @@ if [ $? -ne 0 ]; then version=`date +%Y%m%d`-`git rev-parse --short HEAD` fi +if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + version=`echo $TRAVIS_PULL_REQUEST_SHA | cut -c1-7` +fi + for board in $ATMEL_BOARDS; do mkdir -p bin/$board/ cp atmel-samd/build-$board/firmware.bin bin/$board/adafruit-circuitpython-$board-$version.bin (( exit_status = exit_status || $? )) cp atmel-samd/build-$board/firmware.uf2 bin/$board/adafruit-circuitpython-$board-$version.uf2 (( exit_status = exit_status || $? )) + # Only upload to Rosie if its a pull request. + if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + for rosie in $ROSIE_SETUPS; do + echo "Uploading to https://$rosie.ngrok.io/upload/$TRAVIS_PULL_REQUEST_SHA" + curl -F "file=@bin/$board/adafruit-circuitpython-$board-$version.uf2" https://$rosie.ngrok.io/upload/$TRAVIS_PULL_REQUEST_SHA + done + fi done # Skip ESP8266 on Travis