Skip to content

Fix manifest generation #75

Fix manifest generation

Fix manifest generation #75

Workflow file for this run

name: "Build firmwares"
# Run this job on all pushes to master, for pull requests
# as well as tags with a semantic version
on:
push:
branches:
# This avoids having duplicate builds in non-forked PRs
- "master"
release:
types:
- published
pull_request: {}
# Cancel previous PR/branch runs when a new commit is pushed
concurrency:
group: 'build-firmware-${{ github.ref }}'
cancel-in-progress: true
# Allow uploading artifacts to releases
permissions:
contents: write
jobs:
build:
name: ${{ matrix.device }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- device: zwa2
manufacturer: "Nabu Casa"
product: "ZWA-2"
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Create output directory
run: mkdir -p output
- name: Get version
id: version
run: |
if [ -z "${{ github.event.release.tag_name }}" ]; then
DATE=$(date +%Y%m%d)
COMMIT=$(git rev-parse --short ${{ github.sha }})
VERSION="${DATE}_${COMMIT}"
else
VERSION="${{ github.event.release.tag_name }}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Write version.txt
run: |
echo "Building version ${{ steps.version.outputs.version }}"
echo "${{ steps.version.outputs.version }}" > version.txt
- name: ESP-IDF build
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.4
target: esp32s3
command: |
idf.py build -D ADAPTER_USB_MANUFACTURER_OVERRIDE="${{ matrix.manufacturer }}" \
-D ADAPTER_USB_PRODUCT_OVERRIDE="${{ matrix.product }}"
- name: Create factory bin
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.4
target: esp32s3
path: build
command: |
esptool.py \
--chip esp32s3 \
merge_bin \
-o ../output/${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.factory.bin \
@flash_args
- name: Copy app bin
working-directory: build
run: cp usb2uart.bin ../output/${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.bin
- name: Checksums
working-directory: output
run: |
md5sum ${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.bin | cut -d ' ' -f 1 > ${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.bin.md5
md5sum ${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.factory.bin | cut -d ' ' -f 1 > ${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.factory.bin.md5
sha256sum ${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.bin | cut -d ' ' -f 1 > ${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.bin.sha256
sha256sum ${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.factory.bin | cut -d ' ' -f 1 > ${{ matrix.device }}-esp-bridge.${{ steps.version.outputs.version }}.factory.bin.sha256
- name: Generate EWT manifest
run: |
python3 build_ewt_manifest.py -v ${{ steps.version.outputs.version }} > output/manifest.json
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.device }}-esp-bridge-${{ steps.version.outputs.version }}
path: output/
- name: Upload to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: output/*