From 68349f88b009947de0820910aef3f284238b3449 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Apr 2021 12:16:43 +0800 Subject: [PATCH 1/8] add placeholder index.html to avoid breaking device build (spiffs error) --- data/static/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/static/index.html diff --git a/data/static/index.html b/data/static/index.html new file mode 100644 index 000000000..9297288c7 --- /dev/null +++ b/data/static/index.html @@ -0,0 +1 @@ +not yet supported - soon will be included in build From 49c625627090bb1071735a867ecc3f51355efde3 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Apr 2021 12:23:09 +0800 Subject: [PATCH 2/8] test adding artifacts --- .github/workflows/main.yml | 24 +++++++++++++++++------- .idea/workspace.xml | 5 +---- bin/build-all.sh | 4 ++-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 896d5ccad..4f5c3c517 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,18 +54,28 @@ jobs: run: | pio upgrade - - name: Build for tbeam - run: platformio run -e tbeam - - name: Build for heltec - run: platformio run -e heltec - - name: Build for wisblock RAK4631 - run: platformio run -e rak4631 + # We now run integration test before other build steps (to quickly see runtime failures) - name: Build for native run: platformio run -e native - name: Integration test run: | .pio/build/native/program & - sleep 30 # 5 seconds was not enough + sleep 20 # 5 seconds was not enough echo "Simulator started, launching python test..." python3 -c 'from meshtastic.test import testSimulator; testSimulator()' + # - name: Build for tbeam + # run: platformio run -e tbeam + # - name: Build for heltec + # run: platformio run -e heltec + # - name: Build for wisblock RAK4631 + # run: platformio run -e rak4631 + + - name: Build everything + run: bin/build-all.sh + + - name: Store release zip as an artifact + uses: actions/upload-artifact@v2 + with: + name: firmware + path: release/archive/firmware-*.zip diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 982b81300..826eaac58 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -14,10 +14,7 @@ - - - diff --git a/bin/build-all.sh b/bin/build-all.sh index 9ad4d58d0..be3889aeb 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -4,8 +4,8 @@ set -e VERSION=`bin/buildinfo.py` -BOARDS_ESP32="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec tbeam0.7" -#BOARDS_ESP32=tbeam +#BOARDS_ESP32="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec tbeam0.7" +BOARDS_ESP32=tbeam # FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine BOARDS_NRF52="rak4631" From 0a6d88a2d0ec330ac848d9b887293e5c5517c04b Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Apr 2021 12:23:38 +0800 Subject: [PATCH 3/8] add not complete WIP for wizcore4600 --- boards/wiscore_rak4600.json | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 boards/wiscore_rak4600.json diff --git a/boards/wiscore_rak4600.json b/boards/wiscore_rak4600.json new file mode 100644 index 000000000..56f73f4b5 --- /dev/null +++ b/boards/wiscore_rak4600.json @@ -0,0 +1,71 @@ +{ + "build": { + "arduino": { + "ldscript": "nrf52832_s132_v6.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DNRF52832_XXAA -DNRF52", + "f_cpu": "64000000L", + "hwids": [ + [ + "0x239A", + "0x8029" + ], + [ + "0x239A", + "0x0029" + ], + [ + "0x239A", + "0x002A" + ], + [ + "0x239A", + "0x802A" + ] + ], + "usb_product": "Feather nRF52832 Express", + "mcu": "nrf52832", + "variant": "WisCore_RAK4600_Board", + "bsp": { + "name": "adafruit" + }, + "softdevice": { + "sd_flags": "-DS132", + "sd_name": "s132", + "sd_version": "6.1.1", + "sd_fwid": "0x00B7" + }, + "zephyr": { + "variant": "nrf52_adafruit_feather" + } + }, + "connectivity": [ + "bluetooth" + ], + "debug": { + "jlink_device": "nRF52832_xxAA", + "svd_path": "nrf52.svd" + }, + "frameworks": [ + "arduino", + "zephyr" + ], + "name": "Adafruit Bluefruit nRF52832 Feather", + "upload": { + "maximum_ram_size": 65536, + "maximum_size": 524288, + "require_upload_port": true, + "speed": 115200, + "protocol": "nrfutil", + "protocols": [ + "jlink", + "nrfjprog", + "nrfutil", + "stlink" + ] + }, + "url": "https://www.adafruit.com/product/3406", + "vendor": "Adafruit" +} \ No newline at end of file From c5e0ca5c02124032cc57c24696a464a87e850556 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Apr 2021 12:34:07 +0800 Subject: [PATCH 4/8] fix error seen on virgin machines --- bin/build-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build-all.sh b/bin/build-all.sh index be3889aeb..4be321aec 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -18,7 +18,7 @@ ARCHIVEDIR=release/archive rm -f $OUTDIR/firmware* mkdir -p $OUTDIR/bins $ARCHIVEDIR -rm -r $OUTDIR/bins/* +rm -r $OUTDIR/bins/* || true mkdir -p $OUTDIR/bins/universal $OUTDIR/elfs/universal # build the named environment and copy the bins to the release directory From c5bb62202d28e81a827f4ded5d60167ac4124e10 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Apr 2021 12:46:21 +0800 Subject: [PATCH 5/8] keep prebuilds for all commits for 30 days --- .github/workflows/main.yml | 5 +++-- bin/build-all.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f5c3c517..4cb461c4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,5 +77,6 @@ jobs: - name: Store release zip as an artifact uses: actions/upload-artifact@v2 with: - name: firmware - path: release/archive/firmware-*.zip + name: built + path: release/archive/firmware-*.zip + rentention-days: 30 diff --git a/bin/build-all.sh b/bin/build-all.sh index 4be321aec..110b3c915 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -4,8 +4,8 @@ set -e VERSION=`bin/buildinfo.py` -#BOARDS_ESP32="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec tbeam0.7" -BOARDS_ESP32=tbeam +BOARDS_ESP32="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec tbeam0.7" +#BOARDS_ESP32=tbeam # FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine BOARDS_NRF52="rak4631" From e17374080f351a80a494356d1ad35f511c9f58f3 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Apr 2021 13:37:00 +0800 Subject: [PATCH 6/8] Add a release build workflow --- .github/actions/initbuild.yml | 34 +++++++++++++++++++++++++ .github/workflows/main.yml | 32 ++---------------------- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 30 deletions(-) create mode 100644 .github/actions/initbuild.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/actions/initbuild.yml b/.github/actions/initbuild.yml new file mode 100644 index 000000000..a26085582 --- /dev/null +++ b/.github/actions/initbuild.yml @@ -0,0 +1,34 @@ +runs: + using: "composite" + steps: + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Cache python libs + uses: actions/cache@v1 + id: cache-pip # needed in if test + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip + + - name: Upgrade python tools + # We actually want to run this every time + # if: steps.cache-pip.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + pip install -U platformio meshtastic adafruit-nrfutil + + - name: Cache platformio + uses: actions/cache@v1 + id: cache-platformio # needed in if test + with: + path: ~/.platformio + key: ${{ runner.os }}-platformio + + - name: Upgrade platformio + run: | + pio upgrade + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4cb461c4f..f72f5fc65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,35 +24,7 @@ jobs: with: submodules: 'recursive' - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: 3.x - - - name: Cache python libs - uses: actions/cache@v1 - id: cache-pip # needed in if test - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip - - - name: Upgrade python tools - # We actually want to run this every time - # if: steps.cache-pip.outputs.cache-hit != 'true' - run: | - python -m pip install --upgrade pip - pip install -U platformio meshtastic adafruit-nrfutil - - - name: Cache platformio - uses: actions/cache@v1 - id: cache-platformio # needed in if test - with: - path: ~/.platformio - key: ${{ runner.os }}-platformio - - - name: Upgrade platformio - run: | - pio upgrade + - uses: ./.github/actions/initbuild # We now run integration test before other build steps (to quickly see runtime failures) - name: Build for native @@ -79,4 +51,4 @@ jobs: with: name: built path: release/archive/firmware-*.zip - rentention-days: 30 + retention-days: 30 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..3f5125ddc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Make Release +on: + # Can optionally take parameters from the github UI, more info here https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/#:~:text=You%20can%20now%20create%20workflows,the%20workflow%20is%20run%20on. + workflow_dispatch: + inputs: + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - uses: ./.github/actions/initbuild + + # Will be available in steps.version.outputs.version + - name: Get version string + run: echo "::set-output name=version::$(./bin/buildinfo.py)" + id: version + + - name: Build everything + run: bin/build-all.sh + + - name: release + uses: actions/create-release@v1 + id: create_release + with: + draft: true + prerelease: true + release_name: ${{ steps.version.outputs.version }} + tag_name: ${{ github.ref }} + body: Text to be filled in by human + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: upload artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: release/archive/firmware-${{ steps.version.outputs.version }}.zip + asset_name: firmware-${{ steps.version.outputs.version }}.zip + asset_content_type: application/zip \ No newline at end of file From ccd87911a6790bbd1f072e83fba3fbf3240717f3 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Apr 2021 13:39:43 +0800 Subject: [PATCH 7/8] move shared actions --- .github/actions/{initbuild.yml => initbuild/action.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/actions/{initbuild.yml => initbuild/action.yml} (100%) diff --git a/.github/actions/initbuild.yml b/.github/actions/initbuild/action.yml similarity index 100% rename from .github/actions/initbuild.yml rename to .github/actions/initbuild/action.yml From 1ceeb1637a3e2d55ae2cba902c00c1e49bfe170c Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Apr 2021 13:46:14 +0800 Subject: [PATCH 8/8] ugh - github composite actions are broken --- .github/actions/initbuild/action.yml | 4 ++++ .github/workflows/main.yml | 30 +++++++++++++++++++++++++++- .github/workflows/release.yml | 30 +++++++++++++++++++++++++++- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/.github/actions/initbuild/action.yml b/.github/actions/initbuild/action.yml index a26085582..db49b31ad 100644 --- a/.github/actions/initbuild/action.yml +++ b/.github/actions/initbuild/action.yml @@ -1,3 +1,7 @@ +name: 'Common init' + +# WARNING due to https://github.com/actions/runner/issues/646 +# this code can't work - must copy and paste into workflows for now because 'uses' is not supported runs: using: "composite" steps: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f72f5fc65..e316c291a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,35 @@ jobs: with: submodules: 'recursive' - - uses: ./.github/actions/initbuild + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Cache python libs + uses: actions/cache@v1 + id: cache-pip # needed in if test + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip + + - name: Upgrade python tools + # We actually want to run this every time + # if: steps.cache-pip.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + pip install -U platformio meshtastic adafruit-nrfutil + + - name: Cache platformio + uses: actions/cache@v1 + id: cache-platformio # needed in if test + with: + path: ~/.platformio + key: ${{ runner.os }}-platformio + + - name: Upgrade platformio + run: | + pio upgrade # We now run integration test before other build steps (to quickly see runtime failures) - name: Build for native diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f5125ddc..671d88ce9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,35 @@ jobs: with: submodules: 'recursive' - - uses: ./.github/actions/initbuild + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Cache python libs + uses: actions/cache@v1 + id: cache-pip # needed in if test + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip + + - name: Upgrade python tools + # We actually want to run this every time + # if: steps.cache-pip.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + pip install -U platformio meshtastic adafruit-nrfutil + + - name: Cache platformio + uses: actions/cache@v1 + id: cache-platformio # needed in if test + with: + path: ~/.platformio + key: ${{ runner.os }}-platformio + + - name: Upgrade platformio + run: | + pio upgrade # Will be available in steps.version.outputs.version - name: Get version string