Skip to content

Commit

Permalink
Merge pull request #34 from emfcamp/ota-releases
Browse files Browse the repository at this point in the history
Add release action including micropython.bin
  • Loading branch information
MatthewWilkes authored May 4, 2022
2 parents 343c2de + ddf566a commit fd075f9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
pull_request:
workflow_dispatch:
push:
branches: main
tags:
- "v*"
jobs:
Build-Firmware:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -58,3 +59,19 @@ jobs:
micropython/ports/esp32/build-tildamk6/bootloader/bootloader.bin
micropython/ports/esp32/build-tildamk6/partition_table/partition-table.bin
micropython/ports/esp32/build-tildamk6/ota_data_initial.bin
- name: Create latest release for tags
uses: "marvinpinto/action-automatic-releases@latest"
if: github.event_name == 'push'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
title: "Latest release build"
files: |
micropython/ports/esp32/build-tildamk6/micropython.bin
- name: Create specific release for tags
uses: "marvinpinto/action-automatic-releases@latest"
if: github.event_name == 'push'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: |
micropython/ports/esp32/build-tildamk6/micropython.bin
5 changes: 4 additions & 1 deletion drivers/ota/ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// static const char *TAG = "ota";

#define IMAGE_URL "https://raw.githubusercontent.com/tomsci/tidal-ota/main/micropython.bin"
#define IMAGE_URL "https://github.com/emfcamp/TiDAL-Firmware/releases/download/latest/micropython.bin"

// openssl x509 -text -inform DER -in "DigiCert Global Root CA.cer"
static const char kGithubCertificate[] =
Expand Down Expand Up @@ -38,6 +38,9 @@ STATIC mp_obj_t ota_update(mp_obj_t cb_obj) {
esp_http_client_config_t config = {
.url = IMAGE_URL,
.cert_pem = kGithubCertificate,
// This buffer must be big enough to contain any individual request header
// We are redirected to an S3 signed URL that is 548 bytes long!!
.buffer_size_tx = 768,
};
esp_https_ota_config_t ota_config = {
.http_config = &config,
Expand Down

0 comments on commit fd075f9

Please sign in to comment.