-
Notifications
You must be signed in to change notification settings - Fork 9
204 lines (175 loc) · 6.76 KB
/
build.yml
File metadata and controls
204 lines (175 loc) · 6.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: Build and Release
on:
push:
branches: [main]
tags: ["v*"]
paths: ["firmware/**"]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
ARM_GNU_TOOLCHAIN_VERSION: 13.3.rel1
SIMPLICITY_SDK_VERSION: v2025.6.2
strategy:
matrix:
board: ["efr32xg22e", "rf-bm-bg22c3"]
steps:
# Checkout repository and submodules
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: true
# Set up dependencies
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y unzip wget
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "21"
# Setup ARM GNU Toolchain
- name: Cache ARM GNU Toolchain
id: cache-arm-toolchain
uses: actions/cache@v4
with:
path: arm-gnu-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}-x86_64-arm-none-eabi
key: arm-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}
- name: Install ARM GNU Toolchain
if: steps.cache-arm-toolchain.outputs.cache-hit != 'true'
run: |
wget -q https://developer.arm.com/-/media/Files/downloads/gnu/${{ env.ARM_GNU_TOOLCHAIN_VERSION }}/binrel/arm-gnu-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}-x86_64-arm-none-eabi.tar.xz
tar xf arm-gnu-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}-x86_64-arm-none-eabi.tar.xz
- name: Add ARM GNU Toolchain to PATH
run: |
echo "$PWD/arm-gnu-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}-x86_64-arm-none-eabi/bin" >> $GITHUB_PATH
# Setup Simplicity SDK
- name: Cache Simplicity SDK
id: cache-simplicity-sdk
uses: actions/cache@v4
with:
path: simplicity_sdk
key: simplicity-sdk-${{ env.SIMPLICITY_SDK_VERSION }}
- name: Install Simplicity SDK
if: steps.cache-simplicity-sdk.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/SiliconLabs/simplicity_sdk/releases/download/${{ env.SIMPLICITY_SDK_VERSION }}/simplicity-sdk.zip
unzip -q simplicity-sdk.zip -d simplicity_sdk
# Setup SLC-CLI
- name: Cache SLC-CLI
id: cache-slc-cli
uses: actions/cache@v4
with:
path: slc_cli
key: slc-cli-${{ runner.os }}
- name: Install SLC-CLI
if: steps.cache-slc-cli.outputs.cache-hit != 'true'
run: |
wget -q https://www.silabs.com/documents/login/software/slc_cli_linux.zip
unzip -q slc_cli_linux.zip
chmod +x slc_cli/slc
- name: Add SLC-CLI to PATH
run: |
echo "$PWD/slc_cli" >> $GITHUB_PATH
- name: Configure SLC-CLI
run: |
slc configuration --sdk simplicity_sdk
slc configuration --gcc-toolchain arm-gnu-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}-x86_64-arm-none-eabi
slc signature trust --sdk simplicity_sdk
# Setup Simplicity Commander
- name: Cache Simplicity Commander
id: cache-simplicity-commander
uses: actions/cache@v4
with:
path: commander
key: simplicity-commander-${{ runner.os }}
- name: Install Simplicity Commander
if: steps.cache-simplicity-commander.outputs.cache-hit != 'true'
run: |
wget -q https://www.silabs.com/documents/login/software/SimplicityCommander-Linux.zip
unzip -q SimplicityCommander-Linux.zip
tar -xf SimplicityCommander-Linux/Commander_linux_x86_64_*.tar.bz
- name: Add Simplicity Commander to PATH
run: |
echo "$PWD/commander" >> $GITHUB_PATH
# Build bootloader
- name: Generate bootloader project files
working-directory: firmware/bootloader
run: |
slc generate bootloader.slcp \
--with "${{ matrix.board }};wavephoenix" \
--sdk-extensions=../boards \
-o makefile \
-d target/${{ matrix.board }}
- name: Build bootloader
working-directory: firmware/bootloader
run: |
make -C target/${{ matrix.board }} -f bootloader.Makefile release
# Build firmware
- name: Generate app firmware project files
working-directory: firmware/app
run: |
slc generate wavephoenix.slcp \
--with "${{ matrix.board }};wavephoenix" \
--sdk-extensions=../boards,../libjoybus,../libwavebird \
-o makefile \
-d target/${{ matrix.board }}
- name: Build app firmware
working-directory: firmware/app
run: |
make -C target/${{ matrix.board }} -f wavephoenix.Makefile release
- name: Generate app firmware .gbl
working-directory: firmware/app/target/${{ matrix.board }}/build/release
run: |
commander gbl create \
--app wavephoenix.s37 \
wavephoenix.gbl
# Upload artifacts
- name: Rename artifacts
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
VERSION=${GITHUB_REF_NAME}
else
VERSION="trunk"
fi
mv firmware/bootloader/target/${{ matrix.board }}/build/release/bootloader.hex "wavephoenix-bootloader-${VERSION}-${{ matrix.board }}.hex"
mv firmware/app/target/${{ matrix.board }}/build/release/wavephoenix.hex "wavephoenix-receiver-${VERSION}-${{ matrix.board }}.hex"
mv firmware/app/target/${{ matrix.board }}/build/release/wavephoenix.gbl "wavephoenix-receiver-${VERSION}-${{ matrix.board }}.gbl"
- name: Update trunk tag
if: github.ref == 'refs/heads/main'
run: |
git tag -f trunk
git push -f origin trunk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts to trunk release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
with:
files: |
wavephoenix-bootloader-*.hex
wavephoenix-receiver-*.hex
wavephoenix-receiver-*.gbl
tag_name: trunk
name: Trunk Builds
body: Automated build from main branch, not guaranteed to be stable.
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts to tagged release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
wavephoenix-bootloader-*.hex
wavephoenix-receiver-*.hex
wavephoenix-receiver-*.gbl
tag_name: ${{ github.ref }}
name: ${{ github.ref_name }}
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}