mirror of
https://github.com/sascha-hemi/HGD4_reversed.git
synced 2026-03-21 08:06:17 +01:00
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
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
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install platformio
|
|
pip install adafruit-nrfutil
|
|
|
|
- name: Build Firmware
|
|
run: |
|
|
cd NRF_firmware
|
|
pio run
|
|
|
|
- name: Copy Production Firmware
|
|
run: |
|
|
mkdir firmware_output
|
|
cp /home/runner/work/HGD4_reversed/HGD4_reversed/NRF_firmware/.pio/build/hgd4/production.hex firmware_output/production.hex
|
|
cp /home/runner/work/HGD4_reversed/HGD4_reversed/NRF_firmware/.pio/build/hgd4/dfu.zip firmware_output/dfu.zip
|
|
|
|
- name: Rename Files with Release Tag
|
|
run: |
|
|
TAG_NAME=${{ github.event.release.tag_name }}
|
|
mv firmware_output/production.hex firmware_output/production-${TAG_NAME}.hex
|
|
mv firmware_output/dfu.zip firmware_output/dfu-${TAG_NAME}.zip
|
|
|
|
- name: Upload Firmware to Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
firmware_output/production-${{ github.event.release.tag_name }}.hex
|
|
firmware_output/dfu-${{ github.event.release.tag_name }}.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|