Skip to content

Commit 2d91882

Browse files
authored
Add release build script
1 parent 60e6155 commit 2d91882

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release nRF Firmware
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-upload:
9+
name: Build & Upload Firmware
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@v4
15+
16+
- name: Install PlatformIO
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install platformio
20+
pip install adafruit-nrfutil
21+
22+
- name: Build Firmware
23+
run: |
24+
cd NRF_firmware
25+
pio run
26+
27+
- name: Copy Production Firmware
28+
run: |
29+
mkdir firmware_output
30+
cp .pio/build/oeplnrf/production.hex firmware_output/production.hex
31+
32+
- name: Rename Files with Release Tag
33+
run: |
34+
TAG_NAME=${{ github.event.release.tag_name }}
35+
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application firmware_output/production.hex firmware_output/dfu.zip
36+
mv firmware_output/production.hex firmware_output/production-${TAG_NAME}.hex
37+
mv firmware_output/dfu.zip firmware_output/dfu-${TAG_NAME}.zip
38+
39+
- name: Add files to release
40+
uses: svenstaro/upload-release-action@v2
41+
with:
42+
repo_token: ${{ secrets.GITHUB_TOKEN }}
43+
file: firmware_output/*
44+
tag: ${{ github.ref }}
45+
file_glob: true
46+
overwrite: true

0 commit comments

Comments
 (0)