From 7397927b776cebf11d7959cb8d058711b28b7a27 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 14:30:53 +0200 Subject: [PATCH 01/12] use cache --- .github/workflows/build.yaml | 161 +++++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 56009803..4214dea7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -158,6 +158,18 @@ jobs: name: "update__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" path: ./dist/* + - name: Store generated files in cache + uses: actions/cache@v3 + with: + path: | + ./code/.pio/build/esp32cam/firmware.bin + ./code/.pio/build/esp32cam/partitions.bin + ./code/.pio/build/esp32cam/bootloader.bin + ./sd-card/html/version.txt + ./dist + key: ${{ github.run_number }} + + ######################################################################################### @@ -182,77 +194,96 @@ jobs: key: ${{ github.run_number }} ######################################################################################### -## Prepare release +## Prepare and create release ######################################################################################### + release: + runs-on: ubuntu-latest + needs: pack-for-OTA-v2 - - name: Set Variables - id: vars - run: | - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + steps: + - uses: actions/checkout@v2 - - name: Prepare artifacts for release - if: startsWith(github.ref, 'refs/tags/') - run: | - mkdir -p release - # copy builds to release folder - cp -f "./code/.pio/build/esp32cam/firmware.bin" "release/firmware.bin" - cp -f "./code/.pio/build/esp32cam/bootloader.bin" "release/bootloader.bin" - cp -f "./code/.pio/build/esp32cam/partitions.bin" "release/partitions.bin" - rm -rf ./release/* - cd sd-card - zip -r ../release/html.zip html - # create a update.zip like "update__rolling" - cd ../dist - zip -r ../release/update.zip . - + - name: Get generated files from cache + uses: actions/cache@v3 + with: + path: | + ./code/.pio/build/esp32cam/firmware.bin + ./code/.pio/build/esp32cam/partitions.bin + ./code/.pio/build/esp32cam/bootloader.bin + ./sd-card/html/version.txt + ./dist + key: ${{ github.run_number }} - - name: Upload initial_esp32_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI + CNN) - uses: actions/upload-artifact@v3 - with: - name: "initial_esp32_setup__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" - path: ./firmware + - name: Set Variables + id: vars + run: | + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - # extract the version used in next step - - id: get_version - if: startsWith(github.ref, 'refs/tags/') - uses: battila7/get-version-action@v2 - # the changelog [unreleased] will now be changed to the release version - - name: Update changelog - uses: thomaseizinger/keep-a-changelog-new-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - changelogPath: Changelog.md - version: ${{ steps.get_version.outputs.version-without-v }} + - name: Prepare artifacts for release + if: startsWith(github.ref, 'refs/tags/') + run: | + mkdir -p firmware + mkdir -p firmware + # copy builds to firmware folder + cp -f "./code/.pio/build/esp32cam/firmware.bin" "release/firmware.bin" + cp -f "./code/.pio/build/esp32cam/bootloader.bin" "release/bootloader.bin" + cp -f "./code/.pio/build/esp32cam/partitions.bin" "release/partitions.bin" + rm -rf ./release/* + cd sd-card + zip -r ../release/html.zip html + # create a update.zip like "update__rolling" + cd ../dist + zip -r ../release/update.zip . + + + - name: Upload initial_esp32_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI) + uses: actions/upload-artifact@v3 + with: + name: "initial_esp32_setup__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" + path: ./release + + + # extract the version used in next step + - id: get_version + if: startsWith(github.ref, 'refs/tags/') + uses: battila7/get-version-action@v2 + + # the changelog [unreleased] will now be changed to the release version + - name: Update changelog + uses: thomaseizinger/keep-a-changelog-new-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + changelogPath: Changelog.md + version: ${{ steps.get_version.outputs.version-without-v }} + + # the release notes will be extracted from changelog + - name: Extract release notes + id: extract-release-notes + if: startsWith(github.ref, 'refs/tags/') + uses: ffurrer2/extract-release-notes@v1 + with: + changelog_file: Changelog.md - # the release notes will be extracted from changelog - - name: Extract release notes - id: extract-release-notes - if: startsWith(github.ref, 'refs/tags/') - uses: ffurrer2/extract-release-notes@v1 - with: - changelog_file: Changelog.md - - # Releases should only be created on master by tagging the last commit. - # all artifacts in firmware folder pushed to the release - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - name: ${{ steps.get_version.outputs.version-without-v }} - body: ${{ steps.extract-release-notes.outputs.release_notes }} - files: | - release/* - + # Releases should only be created on master by tagging the last commit. + # all artifacts in firmware folder pushed to the release + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + name: ${{ steps.get_version.outputs.version-without-v }} + body: ${{ steps.extract-release-notes.outputs.release_notes }} + files: | + release/* + - # Commit&Push Changelog to master branch. Must be manually merged back to rolling - - name: Commit changes and push changes - if: startsWith(github.ref, 'refs/tags/') - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git add Changelog.md - git commit Changelog.md -m "Update Changelog.md for ${{github.event.inputs.versionIncrement}} release" - git push origin HEAD:master + # Commit&Push Changelog to master branch. Must be manually merged back to rolling + - name: Commit changes and push changes + if: startsWith(github.ref, 'refs/tags/') + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add Changelog.md + git commit Changelog.md -m "Update Changelog.md for ${{github.event.inputs.versionIncrement}} release" + git push origin HEAD:master From 5979acc31e9d33a1ae994aa82375084c36eebd52 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 14:35:24 +0200 Subject: [PATCH 02/12] fix firmware folder --- .github/workflows/build.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4214dea7..404de1e3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -221,27 +221,28 @@ jobs: - name: Prepare artifacts for release - if: startsWith(github.ref, 'refs/tags/') run: | mkdir -p firmware - mkdir -p firmware + mkdir -p release # copy builds to firmware folder - cp -f "./code/.pio/build/esp32cam/firmware.bin" "release/firmware.bin" - cp -f "./code/.pio/build/esp32cam/bootloader.bin" "release/bootloader.bin" - cp -f "./code/.pio/build/esp32cam/partitions.bin" "release/partitions.bin" - rm -rf ./release/* + cp -f "./code/.pio/build/esp32cam/firmware.bin" "firmware/firmware.bin" + cp -f "./code/.pio/build/esp32cam/bootloader.bin" "firmware/bootloader.bin" + cp -f "./code/.pio/build/esp32cam/partitions.bin" "firmware/partitions.bin" + rm -rf ./firmware/* cd sd-card zip -r ../release/html.zip html # create a update.zip like "update__rolling" cd ../dist zip -r ../release/update.zip . + cd ../firmware + zip -r ../release/initial_esp32_setup.zip . - name: Upload initial_esp32_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI) uses: actions/upload-artifact@v3 with: name: "initial_esp32_setup__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" - path: ./release + path: ./firmware # extract the version used in next step From 3f8b38a1ce499dd5fed8acb74ad4af464ca01f01 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 14:49:53 +0200 Subject: [PATCH 03/12] fix delete firmware folder --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 404de1e3..5c36405c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -223,6 +223,7 @@ jobs: - name: Prepare artifacts for release run: | mkdir -p firmware + rm -rf firmware/* mkdir -p release # copy builds to firmware folder cp -f "./code/.pio/build/esp32cam/firmware.bin" "firmware/firmware.bin" From 64d25f416a84609abb6dffb5d0c002944653e255 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 15:16:09 +0200 Subject: [PATCH 04/12] debug --- .github/workflows/build.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5c36405c..fce21d0c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -162,12 +162,8 @@ jobs: uses: actions/cache@v3 with: path: | - ./code/.pio/build/esp32cam/firmware.bin - ./code/.pio/build/esp32cam/partitions.bin - ./code/.pio/build/esp32cam/bootloader.bin - ./sd-card/html/version.txt ./dist - key: ${{ github.run_number }} + key: ${{ github.run_number }}-dist @@ -214,6 +210,13 @@ jobs: ./dist key: ${{ github.run_number }} + - name: Get generated files from cache + uses: actions/cache@v3 + with: + path: | + ./dist + key: ${{ github.run_number }}-dist + - name: Set Variables id: vars run: | @@ -222,6 +225,7 @@ jobs: - name: Prepare artifacts for release run: | + ls -la ./dist mkdir -p firmware rm -rf firmware/* mkdir -p release From d3675f269d76248aabdecef23cc482b2b84d2ed2 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 15:27:41 +0200 Subject: [PATCH 05/12] fix removal --- .github/workflows/build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fce21d0c..5791ffbb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -233,7 +233,6 @@ jobs: cp -f "./code/.pio/build/esp32cam/firmware.bin" "firmware/firmware.bin" cp -f "./code/.pio/build/esp32cam/bootloader.bin" "firmware/bootloader.bin" cp -f "./code/.pio/build/esp32cam/partitions.bin" "firmware/partitions.bin" - rm -rf ./firmware/* cd sd-card zip -r ../release/html.zip html # create a update.zip like "update__rolling" From 8e39e83c38709a2e731eb2ea9af7a735a96edbd7 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 15:45:35 +0200 Subject: [PATCH 06/12] use new cache after pack-for-OTA-v2 --- .github/workflows/build.yaml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5791ffbb..99caa9c3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -162,8 +162,12 @@ jobs: uses: actions/cache@v3 with: path: | + ./code/.pio/build/esp32cam/firmware.bin + ./code/.pio/build/esp32cam/partitions.bin + ./code/.pio/build/esp32cam/bootloader.bin + ./sd-card/html/version.txt ./dist - key: ${{ github.run_number }}-dist + key: ${{ github.run_number }}-pack-for-OTA-v2 @@ -207,15 +211,8 @@ jobs: ./code/.pio/build/esp32cam/partitions.bin ./code/.pio/build/esp32cam/bootloader.bin ./sd-card/html/version.txt - ./dist - key: ${{ github.run_number }} - - - name: Get generated files from cache - uses: actions/cache@v3 - with: - path: | - ./dist - key: ${{ github.run_number }}-dist + ./dist + key: ${{ github.run_number }}-pack-for-OTA-v2 - name: Set Variables id: vars From 592a52ef0bde7fb6eb1f7732999eb5b0a1cb9a5c Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 25 Sep 2022 14:06:55 +0000 Subject: [PATCH 07/12] Update Changelog.md for release --- Changelog.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Changelog.md b/Changelog.md index efe63fff..fe115f1d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,15 +1,18 @@ # Changelog ## [Unreleased] + +## [11.4.2] - 2022-09-25 + ### Added -- automatic release creation -- newest firmware of rolling branch now uploaded to -- #1068 new safer and easier update mechanismn. Use only the update.zip of the release for firmware, html and new models. +- automatic release creation +- newest firmware of rolling branch now uploaded to +- \#1068 new safer and easier update mechanismn. Use only the update.zip of the release for firmware, html and new models. ### Fixed -- #1029 wrong change of checkDigitConsistency now working like releases before 11.3.1 +- \#1029 wrong change of checkDigitConsistency now working like releases before 11.3.1 ## [10.6.2] - (2022-07-24) @@ -566,6 +569,8 @@ External Illumination - Initial Version -[Unreleased]: https://github.com/haverland/AI-on-the-edge-device/compare/11.3.9...HEAD +[Unreleased]: https://github.com/haverland/AI-on-the-edge-device/compare/11.4.2...HEAD + +[11.4.2]: https://github.com/haverland/AI-on-the-edge-device/compare/10.6.2...11.4.2 [11.3.9]: https://github.com/haverland/AI-on-the-edge-device/compare/10.6.2...11.3.9 From e92ff43e094514f02a5269945f23242b11f0b74d Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 16:14:12 +0200 Subject: [PATCH 08/12] fix html.zip should part of inital setup.zip as part of sd-card --- code/components/jomjol_fileserver_ota/server_file.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/components/jomjol_fileserver_ota/server_file.cpp b/code/components/jomjol_fileserver_ota/server_file.cpp index 8bfc31e3..d656fed2 100644 --- a/code/components/jomjol_fileserver_ota/server_file.cpp +++ b/code/components/jomjol_fileserver_ota/server_file.cpp @@ -49,8 +49,8 @@ extern "C" { /* Max size of an individual file. Make sure this * value is same as that set in upload_script.html */ -#define MAX_FILE_SIZE (2000*1024) // 200 KB -#define MAX_FILE_SIZE_STR "2000KB" +#define MAX_FILE_SIZE (4000*1024) // 4000 KB +#define MAX_FILE_SIZE_STR "4000KB" /* Scratch buffer size */ From 6f9d21fc217e0536e672fdc30ad4bafd8d77933d Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 16:15:40 +0200 Subject: [PATCH 09/12] fix initial release.zip --- .github/workflows/build.yaml | 3 +-- Changelog.md | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 99caa9c3..5e3e76e0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -230,8 +230,7 @@ jobs: cp -f "./code/.pio/build/esp32cam/firmware.bin" "firmware/firmware.bin" cp -f "./code/.pio/build/esp32cam/bootloader.bin" "firmware/bootloader.bin" cp -f "./code/.pio/build/esp32cam/partitions.bin" "firmware/partitions.bin" - cd sd-card - zip -r ../release/html.zip html + zip -r ./firmware/sd-card.zip sd-card # create a update.zip like "update__rolling" cd ../dist zip -r ../release/update.zip . diff --git a/Changelog.md b/Changelog.md index fe115f1d..f29d9b89 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,8 +2,6 @@ ## [Unreleased] -## [11.4.2] - 2022-09-25 - ### Added - automatic release creation From a9d77a000508bd2967eaa222566715b54f9c6342 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 16:40:53 +0200 Subject: [PATCH 10/12] fix path --- .github/workflows/build.yaml | 2 +- code/components/jomjol_fileserver_ota/server_file.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5e3e76e0..27516344 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -232,7 +232,7 @@ jobs: cp -f "./code/.pio/build/esp32cam/partitions.bin" "firmware/partitions.bin" zip -r ./firmware/sd-card.zip sd-card # create a update.zip like "update__rolling" - cd ../dist + cd ./dist zip -r ../release/update.zip . cd ../firmware zip -r ../release/initial_esp32_setup.zip . diff --git a/code/components/jomjol_fileserver_ota/server_file.cpp b/code/components/jomjol_fileserver_ota/server_file.cpp index d656fed2..d6515c9f 100644 --- a/code/components/jomjol_fileserver_ota/server_file.cpp +++ b/code/components/jomjol_fileserver_ota/server_file.cpp @@ -757,7 +757,7 @@ std::string unzip_new(std::string _in_zip_file, std::string _target_zip, std::st p = mz_zip_reader_extract_file_to_heap(&zip_archive, archive_filename, &uncomp_size, 0); if (!p) { - printf("mz_zip_reader_extract_file_to_heap() failed!\n"); + printf("mz_zip_reader_extract_file_to_heap() failed! File%s\n", archive_filename); mz_zip_reader_end(&zip_archive); return ret; } From 6c433d83fc022292d15bd665c72c58da5ca2b693 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 25 Sep 2022 15:06:17 +0000 Subject: [PATCH 11/12] Update Changelog.md for release --- Changelog.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index f29d9b89..437141b1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [11.4.3] - 2022-09-25 + ### Added - automatic release creation @@ -567,7 +569,9 @@ External Illumination - Initial Version -[Unreleased]: https://github.com/haverland/AI-on-the-edge-device/compare/11.4.2...HEAD +[Unreleased]: https://github.com/haverland/AI-on-the-edge-device/compare/11.4.3...HEAD + +[11.4.3]: https://github.com/haverland/AI-on-the-edge-device/compare/10.6.2...11.4.3 [11.4.2]: https://github.com/haverland/AI-on-the-edge-device/compare/10.6.2...11.4.2 From 6634b36f4ad6d6e36ecaa903166a0ea337aff51b Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Sun, 25 Sep 2022 17:19:32 +0200 Subject: [PATCH 12/12] new entries for the next release --- Changelog.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 437141b1..50a27a06 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,8 +2,6 @@ ## [Unreleased] -## [11.4.3] - 2022-09-25 - ### Added - automatic release creation