Release Firmware #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release nRF Firmware | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-upload: | |
| name: Build & Upload Firmware | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Install PlatformIO & Tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install platformio | |
| pip install adafruit-nrfutil | |
| curl -L https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2conv.py -o uf2conv.py | |
| curl -L https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2families.json -o uf2families.jso | |
| chmod +x uf2conv.py | |
| - name: Build Firmware | |
| run: | | |
| pio run | |
| - name: Copy Production Firmware | |
| run: | | |
| mkdir firmware_output | |
| cp .pio/build/oeplnrf/firmware.hex firmware_output/production.hex | |
| - name: Rename & Package | |
| run: | | |
| TAG_NAME=${{ github.event.release.tag_name }} | |
| adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application firmware_output/production.hex firmware_output/dfu.zip | |
| mv firmware_output/production.hex firmware_output/production-${TAG_NAME}.hex | |
| mv firmware_output/dfu.zip firmware_output/dfu-${TAG_NAME}.zip | |
| python uf2conv.py firmware_output/production-${TAG_NAME}.hex \ | |
| --family 0xADA52840 \ | |
| --output firmware_output/production-${TAG_NAME}.uf2 | |
| - name: Upload Release Assets | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: firmware_output/* | |
| tag: ${{ github.ref }} | |
| file_glob: true | |
| overwrite: true |