diff options
| author | Juan Biondi <juanernestobiondi@gmail.com> | 2018-12-12 21:05:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-12 21:05:16 +0100 |
| commit | 749b2b0aacffb0dc3445699ef5251cee723160ff (patch) | |
| tree | f447fdb6cf42a14596a9f75a584fb4c600cc8e70 /tools | |
| parent | e766f6e4ad827ce2021978d5a4a688bb73fd11e2 (diff) | |
| parent | 6773fe6a422343496a0ce6bbb8eca08d65eb7d3e (diff) | |
Merge pull request #2 from adafruit/master
Get latest
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/build_board_info.py | 22 | ||||
| -rwxr-xr-x | tools/build_release_files.py (renamed from tools/build_adafruit_bins.py) | 12 |
2 files changed, 22 insertions, 12 deletions
diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 0e9389a02..379cf55c4 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -21,21 +21,29 @@ HEX = ('hex',) # Default extensions extension_by_port = { - "nrf": BIN, + "nrf": UF2, "esp8266": BIN, "atmel-samd": UF2, } # Per board overrides extension_by_board = { - "feather_nrf52832": BIN, + # samd "arduino_mkr1300": BIN, "arduino_zero": BIN, "feather_m0_adalogger": BIN_UF2, "feather_m0_basic": BIN_UF2, "feather_m0_rfm69": BIN, "feather_m0_rfm9x": BIN, - "makerdiary_nrf52840_mdk": HEX + + # nrf52832 + "feather_nrf52832": BIN, + "pca10040": BIN, + + # nRF52840 dev kits that may not have UF2 bootloaders, + "makerdiary_nrf52840_mdk": HEX, + "pca10056": BIN_UF2, + "pca10059": BIN_UF2 } def get_languages(): @@ -62,7 +70,7 @@ def get_version_info(): version = None sha = git("rev-parse", "--short", "HEAD").stdout.decode("utf-8") try: - version = git("describe", "--tags", "--exact-match").stdout.decode("utf-8") + version = git("describe", "--tags", "--exact-match").stdout.decode("utf-8").strip() except sh.ErrorReturnCode_128: # No exact match pass @@ -212,7 +220,7 @@ def generate_download_info(): board_path = os.path.join("../ports", port, "boards") for board_path in os.scandir(board_path): if board_path.is_dir(): - board_files = os.listdir(board_path) + board_files = os.listdir(board_path.path) board_id = board_path.name board_info = board_mapping[board_id] @@ -236,8 +244,10 @@ def generate_download_info(): changes["new_languages"] = set(languages) - previous_languages - if changes["new_languages"]: + if changes["new_release"]: create_pr(changes, current_info, git_info) + else: + print("No new release to update") if __name__ == "__main__": if "TRAVIS_TAG" in os.environ and os.environ["TRAVIS_TAG"]: diff --git a/tools/build_adafruit_bins.py b/tools/build_release_files.py index 94c31ad33..6bf418fe6 100755 --- a/tools/build_adafruit_bins.py +++ b/tools/build_release_files.py @@ -1,6 +1,4 @@ import os -from sh import rm -from sh import make import sys import subprocess import shutil @@ -8,7 +6,7 @@ import build_board_info as build_info import time for port in build_info.SUPPORTED_PORTS: - rm("-rf", "../ports/{}/build*".format(port)) + result = subprocess.run("rm -rf ../ports/{}/build*".format(port), shell=True) ROSIE_SETUPS = ["rosie-ci"] rosie_ok = {} @@ -60,8 +58,9 @@ for board in build_boards: if travis: print('travis_fold:start:adafruit-bins-{}-{}\\r'.format(language, board)) print("Build {} for {} took {:.2f}s and {}".format(board, language, build_duration, success)) - print(make_result.stdout.decode("utf-8")) - print(other_output) + if make_result.returncode != 0: + print(make_result.stdout.decode("utf-8")) + print(other_output) # Only upload to Rosie if its a pull request. if travis: for rosie in ROSIE_SETUPS: @@ -72,6 +71,7 @@ for board in build_boards: if travis: print('travis_fold:end:adafruit-bins-{}-{}\\r'.format(language, board)) - print() + # Flush so travis will see something before 10 minutes has passed. + print(flush=True) sys.exit(exit_status) |
