mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 21:46:55 +03:00
Merge pull request #1074 from haverland/rolling
Release creation like CaCo3's update-ota2
This commit is contained in:
160
.github/workflows/build.yaml
vendored
160
.github/workflows/build.yaml
vendored
@@ -158,6 +158,18 @@ jobs:
|
|||||||
name: "update__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})"
|
name: "update__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})"
|
||||||
path: ./dist/*
|
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 }}-pack-for-OTA-v2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
@@ -181,72 +193,98 @@ jobs:
|
|||||||
./sd-card/html/version.txt
|
./sd-card/html/version.txt
|
||||||
key: ${{ github.run_number }}
|
key: ${{ github.run_number }}
|
||||||
|
|
||||||
- name: Set Variables
|
#########################################################################################
|
||||||
id: vars
|
## Prepare and create release
|
||||||
run: |
|
#########################################################################################
|
||||||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: pack-for-OTA-v2
|
||||||
|
|
||||||
- name: Copy artifacts to firmware folder and create initial_esp32_setup.zip
|
steps:
|
||||||
run: |
|
- uses: actions/checkout@v2
|
||||||
mkdir -p firmware
|
|
||||||
# copy builds to firmware folder for committing in next step
|
|
||||||
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
|
|
||||||
rm -f ../firmware/html.zip
|
|
||||||
rm -f ../firmware/README.md
|
|
||||||
zip -r ../firmware/html.zip html
|
|
||||||
mkdir ../dist
|
|
||||||
cd ../dist
|
|
||||||
|
|
||||||
- name: Upload initial_esp32_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI + CNN)
|
- name: Get generated files from cache
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
name: "initial_esp32_setup__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})"
|
path: |
|
||||||
path: ./firmware
|
./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 }}-pack-for-OTA-v2
|
||||||
|
|
||||||
|
- name: Set Variables
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||||
|
|
||||||
|
|
||||||
# extract the version used in next step
|
- name: Prepare artifacts for release
|
||||||
- id: get_version
|
run: |
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
ls -la ./dist
|
||||||
uses: battila7/get-version-action@v2
|
mkdir -p firmware
|
||||||
|
rm -rf firmware/*
|
||||||
# the changelog [unreleased] will now be changed to the release version
|
mkdir -p release
|
||||||
- name: Update changelog
|
# copy builds to firmware folder
|
||||||
uses: thomaseizinger/keep-a-changelog-new-release@v1
|
cp -f "./code/.pio/build/esp32cam/firmware.bin" "firmware/firmware.bin"
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
cp -f "./code/.pio/build/esp32cam/bootloader.bin" "firmware/bootloader.bin"
|
||||||
with:
|
cp -f "./code/.pio/build/esp32cam/partitions.bin" "firmware/partitions.bin"
|
||||||
changelogPath: Changelog.md
|
zip -r ./firmware/sd-card.zip sd-card
|
||||||
version: ${{ steps.get_version.outputs.version-without-v }}
|
# create a update.zip like "update__rolling"
|
||||||
|
cd ./dist
|
||||||
# the release notes will be extracted from changelog
|
zip -r ../release/update.zip .
|
||||||
- name: Extract release notes
|
cd ../firmware
|
||||||
id: extract-release-notes
|
zip -r ../release/initial_esp32_setup.zip .
|
||||||
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.
|
- name: Upload initial_esp32_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI)
|
||||||
# all artifacts in firmware folder pushed to the release
|
uses: actions/upload-artifact@v3
|
||||||
- name: Release
|
with:
|
||||||
uses: softprops/action-gh-release@v1
|
name: "initial_esp32_setup__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})"
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
path: ./firmware
|
||||||
with:
|
|
||||||
name: ${{ steps.get_version.outputs.version-without-v }}
|
|
||||||
body: ${{ steps.extract-release-notes.outputs.release_notes }}
|
|
||||||
files: |
|
|
||||||
firmware/*
|
|
||||||
|
|
||||||
|
|
||||||
# Commit&Push Changelog to master branch. Must be manually merged back to rolling
|
# extract the version used in next step
|
||||||
- name: Commit changes and push changes
|
- id: get_version
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: |
|
uses: battila7/get-version-action@v2
|
||||||
git config user.name github-actions
|
|
||||||
git config user.email github-actions@github.com
|
# the changelog [unreleased] will now be changed to the release version
|
||||||
git add Changelog.md
|
- name: Update changelog
|
||||||
git commit Changelog.md -m "Update Changelog.md for ${{github.event.inputs.versionIncrement}} release"
|
uses: thomaseizinger/keep-a-changelog-new-release@v1
|
||||||
git push origin HEAD:master
|
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
|
||||||
|
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,7 +7,9 @@
|
|||||||
/sd-card/html/debug/
|
/sd-card/html/debug/
|
||||||
/firmware/
|
/firmware/
|
||||||
version.txt
|
version.txt
|
||||||
|
/dist/
|
||||||
|
/dist_release/
|
||||||
|
/dist_old_ota
|
||||||
CMakeLists.txt.user
|
CMakeLists.txt.user
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles
|
CMakeFiles
|
||||||
|
|||||||
18
Changelog.md
18
Changelog.md
@@ -2,19 +2,15 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [11.3.9] - 2022-09-20
|
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- auto release creation
|
- automatic release creation
|
||||||
|
- newest firmware of rolling branch now uploaded to <https://github.com/jomjol/AI-on-the-edge-device/actions>
|
||||||
### Changed
|
- \#1068 new safer and easier update mechanismn. Use only the update.zip of the release for firmware, html and new models.
|
||||||
|
|
||||||
- something else
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- \#924 - fix of the Fix
|
- \#1029 wrong change of checkDigitConsistency now working like releases before 11.3.1
|
||||||
|
|
||||||
## [10.6.2] - (2022-07-24)
|
## [10.6.2] - (2022-07-24)
|
||||||
|
|
||||||
@@ -571,6 +567,10 @@ External Illumination
|
|||||||
|
|
||||||
- Initial Version
|
- 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.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
|
||||||
|
|
||||||
[11.3.9]: https://github.com/haverland/AI-on-the-edge-device/compare/10.6.2...11.3.9
|
[11.3.9]: https://github.com/haverland/AI-on-the-edge-device/compare/10.6.2...11.3.9
|
||||||
|
|||||||
@@ -753,56 +753,58 @@ std::string unzip_new(std::string _in_zip_file, std::string _target_zip, std::st
|
|||||||
mz_zip_reader_file_stat(&zip_archive, i, &file_stat);
|
mz_zip_reader_file_stat(&zip_archive, i, &file_stat);
|
||||||
sprintf(archive_filename, file_stat.m_filename);
|
sprintf(archive_filename, file_stat.m_filename);
|
||||||
|
|
||||||
|
if (!file_stat.m_is_directory) {
|
||||||
// Try to extract all the files to the heap.
|
// Try to extract all the files to the heap.
|
||||||
p = mz_zip_reader_extract_file_to_heap(&zip_archive, archive_filename, &uncomp_size, 0);
|
p = mz_zip_reader_extract_file_to_heap(&zip_archive, archive_filename, &uncomp_size, 0);
|
||||||
if (!p)
|
if (!p)
|
||||||
{
|
|
||||||
printf("mz_zip_reader_extract_file_to_heap() failed!\n");
|
|
||||||
mz_zip_reader_end(&zip_archive);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save to File.
|
|
||||||
zw = std::string(archive_filename);
|
|
||||||
if (toUpper(zw) == "FIRMWARE.BIN")
|
|
||||||
{
|
|
||||||
zw = _target_bin + zw;
|
|
||||||
ret = zw;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::string _dir = getDirectory(zw);
|
|
||||||
|
|
||||||
if (_dir.length() > 0)
|
|
||||||
{
|
{
|
||||||
zw = _main + zw;
|
printf("mz_zip_reader_extract_file_to_heap() failed on file %s\n", archive_filename);
|
||||||
|
mz_zip_reader_end(&zip_archive);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save to File.
|
||||||
|
zw = std::string(archive_filename);
|
||||||
|
if (toUpper(zw) == "FIRMWARE.BIN")
|
||||||
|
{
|
||||||
|
zw = _target_bin + zw;
|
||||||
|
ret = zw;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
zw = _target_zip + zw;
|
std::string _dir = getDirectory(zw);
|
||||||
|
|
||||||
|
if (_dir.length() > 0)
|
||||||
|
{
|
||||||
|
zw = _main + zw;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
zw = _target_zip + zw;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string filename_zw = zw + SUFFIX_ZW;
|
||||||
|
|
||||||
|
printf("Filename to extract: %s, Zwischenfilename: %s", zw.c_str(), filename_zw.c_str());
|
||||||
|
|
||||||
|
// extrahieren in zwischendatei
|
||||||
|
DeleteFile(filename_zw);
|
||||||
|
FILE* fpTargetFile = OpenFileAndWait(filename_zw.c_str(), "wb");
|
||||||
|
fwrite(p, 1, (uint)uncomp_size, fpTargetFile);
|
||||||
|
fclose(fpTargetFile);
|
||||||
|
|
||||||
|
DeleteFile(zw);
|
||||||
|
RenameFile(filename_zw, zw);
|
||||||
|
DeleteFile(filename_zw);
|
||||||
|
|
||||||
|
printf("Successfully extracted file \"%s\", size %u\n", archive_filename, (uint)uncomp_size);
|
||||||
|
// printf("File data: \"%s\"\n", (const char*)p);
|
||||||
|
|
||||||
|
// We're done.
|
||||||
|
mz_free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
string filename_zw = zw + SUFFIX_ZW;
|
|
||||||
|
|
||||||
printf("Filename to extract: %s, Zwischenfilename: %s", zw.c_str(), filename_zw.c_str());
|
|
||||||
|
|
||||||
// extrahieren in zwischendatei
|
|
||||||
DeleteFile(filename_zw);
|
|
||||||
FILE* fpTargetFile = OpenFileAndWait(filename_zw.c_str(), "wb");
|
|
||||||
fwrite(p, 1, (uint)uncomp_size, fpTargetFile);
|
|
||||||
fclose(fpTargetFile);
|
|
||||||
|
|
||||||
DeleteFile(zw);
|
|
||||||
RenameFile(filename_zw, zw);
|
|
||||||
DeleteFile(filename_zw);
|
|
||||||
|
|
||||||
printf("Successfully extracted file \"%s\", size %u\n", archive_filename, (uint)uncomp_size);
|
|
||||||
// printf("File data: \"%s\"\n", (const char*)p);
|
|
||||||
|
|
||||||
// We're done.
|
|
||||||
mz_free(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the archive, freeing any resources it was using
|
// Close the archive, freeing any resources it was using
|
||||||
|
|||||||
Reference in New Issue
Block a user