Download links now point to S3 via CloudFront

This commit is contained in:
Dan Halbert 2020-02-28 14:57:32 -05:00
parent 1b33cd11fc
commit 1b8a4791f5
2 changed files with 14 additions and 8 deletions

View File

@ -276,10 +276,3 @@ jobs:
- name: Install upload deps
run: |
pip install uritemplate
- name: Upload to Release
run: "[ -z \"$ADABOT_GITHUB_ACCESS_TOKEN\" ] || python3 -u upload_release_files.py"
working-directory: tools
env:
UPLOAD_URL: ${{ github.event.release.upload_url }}
ADABOT_GITHUB_ACCESS_TOKEN: ${{ secrets.BLINKA_GITHUB_ACCESS_TOKEN }}
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')

View File

@ -21,6 +21,10 @@ HEX = ('hex',)
HEX_UF2 = ('hex', 'uf2')
SPK = ('spk',)
# Example:
# https://d111q2jukuzyg1.cloudfront.net/bin/trinket_m0/en_US/adafruit-circuitpython-trinket_m0-en_US-5.0.0-rc.0.uf2
DOWNLOAD_BASE_URL = "https://d111q2jukuzyg1.cloudfront.net/bin"
# Default extensions
extension_by_port = {
"nrf": UF2,
@ -34,6 +38,8 @@ extension_by_port = {
extension_by_board = {
# samd
"arduino_mkr1300": BIN,
"arduino_mkrzero": BIN,
"arduino_nano_33_iot": BIN,
"arduino_zero": BIN,
"feather_m0_adalogger": BIN_UF2,
"feather_m0_basic": BIN_UF2,
@ -275,7 +281,14 @@ def generate_download_info():
files = []
new_version["files"][language] = files
for extension in board_info["extensions"]:
files.append("https://github.com/adafruit/circuitpython/releases/download/{tag}/adafruit-circuitpython-{alias}-{language}-{tag}.{extension}".format(tag=new_tag, alias=alias, language=language, extension=extension))
files.append(
"{base_url}/{alias}/{language}/adafruit-circuitpython-{alias}-{language}-{tag}.{extension}"
.format(
base_url=DOWNLOAD_BASE_URL,
tag=new_tag,
alias=alias,
language=language,
extension=extension))
current_info[alias]["downloads"] = alias_info["download_count"]
current_info[alias]["versions"].append(new_version)