Skip to content

Commit

Permalink
ci: create ota files for esp32
Browse files Browse the repository at this point in the history
  • Loading branch information
felixerdy committed May 31, 2024
1 parent ae39442 commit e7b9410
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/compile-sketches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,32 @@ jobs:
cli-compile-flags: |
- --export-binaries
- name: Create OTA update file
if: startsWith(matrix.board.fqbn, 'esp32')
run: |
git clone https://github.com/arduino-libraries/ArduinoIoTCloud.git
pip install crccheck
cd ArduinoIoTCloud/extras/tools
# Set the Internal Field Separator to newline to handle paths correctly
IFS=$'\n'
# Convert the list of sketch paths into an array
sketch_paths=(${{ matrix.board.sketch-paths }})
for sketch_path in "${sketch_paths[@]}"; do
if [[ "$sketch_path" != "-" ]]; then
echo "Processing sketch path: $sketch_path"
# replace ./ with nothing
clean_sketch_path=${sketch_path//.\//}
python3 lzss.py --encode ${{ github.workspace }}/$sketch_path/build/${{ matrix.board.artifact-name-suffix}}/$clean_sketch_path.ino.bin ${{ runner.temp }}/$clean_sketch_path.ino.lzss
echo "LZSS file created: ${{ runner.temp }}/$clean_sketch_path.ino.lzss"
python3 bin2ota.py ESP32 ${{ runner.temp }}/$clean_sketch_path.ino.lzss ${{ runner.temp }}/$clean_sketch_path.ino.ota
echo "OTA file created: ${{ runner.temp }}/$clean_sketch_path.ino.ota"
mv ${{ runner.temp }}/$clean_sketch_path.ino.ota ${{ github.workspace }}/$sketch_path/build/${{ matrix.board.artifact-name-suffix}}/$clean_sketch_path.ino.ota
fi
done
- name: Export binaries as artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -91,7 +117,7 @@ jobs:
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: release/**/*.bin
artifacts: "release/**/*.bin, release/**/*.ota"
allowUpdates: true
omitBodyDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit e7b9410

Please sign in to comment.