Skip to content

Commit

Permalink
Create ota-release.yml
Browse files Browse the repository at this point in the history
Trying to automate signed OTA update generation.
  • Loading branch information
tcsullivan authored Oct 27, 2024
1 parent 091ea3b commit 6738f3d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ota-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PlatformIO CI

on:
release:
types: [created]

jobs:
generate:
name: Create release-artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/cache@v4.0.0
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5.0.0
with:
python-version: '3.9'
- name: Install Python packages
run: |
pip install --upgrade platformio
pip install --upgrade cryptography
- name: Create files
env:
OTA_KEY: ${{ secrets.OTA_SIGNING_KEY }}
run: |
echo "$OTA_KEY" > "${GITHUB_WORKSPACE}/priv_key.pem"
cp "${GITHUB_WORKSPACE}/noisemeter-device/config.h.example" "${GITHUB_WORKSPACE}/noisemeter-device/config.h"
python "${GITHUB_WORKSPACE}/noisemeter-device/certs.py" -s api.tracket.info > "${GITHUB_WORKSPACE}/noisemeter-device/certs.h"
- name: Build PlatformIO Project
run: pio run -e esp32-pcb

- name: Upload signed firmware
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: '${GITHUB_WORKSPACE}/firmware_signed.bin'

0 comments on commit 6738f3d

Please sign in to comment.