name: Build & Release Firmware on: push: branches: - main tags: - 'v*' workflow_dispatch: jobs: build: name: Build ESP32 Firmware runs-on: ubuntu-latest container: image: espressif/idf:release-v5.1 steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive - name: Compile ESP32 firmware shell: bash run: | . $IDF_PATH/export.sh idf.py build - name: Bundle release artifacts shell: bash run: | mkdir -p release-dist # Primary OTA binary required by on-device update manager: cp build/mtg-rfid-companion.bin release-dist/ # USB flashing bundle: cp build/bootloader/bootloader.bin release-dist/ cp build/partition_table/partition-table.bin release-dist/ cp build/storage.bin release-dist/ cd release-dist tar -czvf full-flash-bundle-${{ gitea.ref_name || 'latest' }}.tar.gz *.bin cd .. - name: Upload Artifacts to Workflow uses: actions/upload-artifact@v4 with: name: mtg-firmware-${{ gitea.ref_name || 'main' }} path: release-dist/* - name: Publish to Gitea Release if: startsWith(github.ref, 'refs/tags/') uses: https://gitea.com/actions/release-action@main continue-on-error: true with: files: | release-dist/mtg-rfid-companion.bin release-dist/full-flash-bundle-${{ gitea.ref_name }}.tar.gz name: "Release ${{ gitea.ref_name }}" draft: false prerelease: false api_key: ${{ secrets.RELEASE_TOKEN || gitea.token }}