11name : Build and Release
22
33on :
4- workflow_dispatch :
54 push :
6- branches :
7- - main
8- paths :
9- - " bootloader/**"
10- - " firmware/**"
11- tags :
12- - " v*"
13-
14- env :
15- REPO_PATH : ${{ github.workspace }}/wavephoenix
16- BOOTLOADER_PATH : ${{ github.workspace }}/wavephoenix/bootloader
17- FIRMWARE_PATH : ${{ github.workspace }}/wavephoenix/firmware
18- GECKO_SDK_PATH : ${{ github.workspace }}/gecko_sdk
19- SIMPLICITY_COMMANDER_PATH : ${{ github.workspace }}/commander
20- SLC_CLI_PATH : ${{ github.workspace }}/slc_cli
21- ARM_TOOLCHAIN_PATH : ${{ github.workspace }}/arm-toolchain
22- GECKO_SDK_VERSION : v4.4.5
23- ARM_GNU_TOOLCHAIN_VERSION : 12.2.rel1
5+ branches : [main]
6+ tags : ["v*"]
7+ paths : ["bootloader/**", "firmware/**"]
8+ pull_request :
9+ branches : [main]
10+ workflow_dispatch :
2411
2512jobs :
2613 build :
2714 runs-on : ubuntu-latest
15+
16+ env :
17+ ARM_GNU_TOOLCHAIN_VERSION : 13.3.rel1
18+ SIMPLICITY_SDK_VERSION : v2025.6.2
19+
2820 strategy :
2921 matrix :
3022 board :
3123 - efr32xg22e
3224 - rf-bm-bg22c3
3325 steps :
26+ - name : Checkout repository
27+ uses : actions/checkout@v6
28+ with :
29+ submodules : true
30+
31+ # Set up dependencies
3432 - name : Install build dependencies
3533 run : |
36- export DEBIAN_FRONTEND=noninteractive
3734 sudo apt-get update
38- sudo apt-get -o Dpkg::Options::="--path-exclude=/usr/share/man/*" -o Dpkg::Options::="--path-exclude=/usr/share/doc/*" -o Dpkg::Options::="--path-exclude=/usr/share/locale*" install -y cmake ninja-build
39-
40- - name : Set up Python
41- uses : actions/setup-python@v5
42- with :
43- python-version : " 3.10"
44-
45- - name : Install Python packages
46- run : pip install jinja2 pyyaml numpy scipy
35+ sudo apt-get install -y cmake ninja-build unzip wget
4736
4837 - name : Set up Java
4938 uses : actions/setup-java@v4
5039 with :
5140 distribution : " corretto"
5241 java-version : " 21"
5342
43+ # Setup ARM GNU Toolchain
5444 - name : Cache ARM GNU Toolchain
5545 id : cache-arm-toolchain
5646 uses : actions/cache@v4
5747 with :
58- path : ${{ env.ARM_TOOLCHAIN_PATH }}
48+ path : arm-gnu-toolchain- ${{ env.ARM_GNU_TOOLCHAIN_VERSION }}-x86_64-arm-none-eabi
5949 key : arm-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}
6050
6151 - name : Install ARM GNU Toolchain
6252 if : steps.cache-arm-toolchain.outputs.cache-hit != 'true'
6353 run : |
64- mkdir -p ${{ env.ARM_TOOLCHAIN_PATH }}
65- curl -L "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 -xJ -C "${{ env.ARM_TOOLCHAIN_PATH }}" --strip-components=1
66-
67- - name : Add ARM GNU Toolchain to PATH
68- run : echo "${{ env.ARM_TOOLCHAIN_PATH }}/bin" >> $GITHUB_PATH
54+ 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
55+ tar xf arm-gnu-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}-x86_64-arm-none-eabi.tar.xz
6956
70- - name : Checkout repository
71- uses : actions/checkout@v4
57+ # Setup Simplicity SDK
58+ - name : Cache Simplicity SDK
59+ id : cache-simplicity-sdk
60+ uses : actions/cache@v4
7261 with :
73- path : ${{ env.REPO_PATH }}
62+ path : simplicity_sdk
63+ key : simplicity-sdk-${{ env.SIMPLICITY_SDK_VERSION }}
7464
75- - name : Cache Gecko SDK
76- id : cache-gecko-sdk
65+ - name : Install Simplicity SDK
66+ if : steps.cache-simplicity-sdk.outputs.cache-hit != 'true'
67+ run : |
68+ wget -q https://github.com/SiliconLabs/simplicity_sdk/releases/download/${{ env.SIMPLICITY_SDK_VERSION }}/simplicity-sdk.zip
69+ unzip -q simplicity-sdk.zip -d simplicity_sdk
70+
71+ # Setup SLC-CLI
72+ - name : Cache SLC-CLI
73+ id : cache-slc-cli
7774 uses : actions/cache@v4
7875 with :
79- path : ${{ env.GECKO_SDK_PATH }}
80- key : gecko-sdk -${{ env.GECKO_SDK_VERSION }}
76+ path : slc_cli
77+ key : slc-cli -${{ runner.os }}
8178
82- - name : Download Gecko SDK
83- if : steps.cache-gecko-sdk .outputs.cache-hit != 'true'
79+ - name : Install SLC-CLI
80+ if : steps.cache-slc-cli .outputs.cache-hit != 'true'
8481 run : |
85- wget -nv https://github.com/SiliconLabs/gecko_sdk/releases/download/${{ env.GECKO_SDK_VERSION }}/gecko-sdk.zip
86- unzip -q gecko-sdk.zip -d ${{ env.GECKO_SDK_PATH }}
82+ wget -q https://www.silabs.com/documents/login/software/slc_cli_linux.zip
83+ unzip -q slc_cli_linux.zip
84+ chmod +x slc_cli/slc
8785
88- - name : " Download Simplicity Commander "
86+ - name : Add SLC-CLI to PATH
8987 run : |
90- wget -nv https://www.silabs.com/documents/login/software/SimplicityCommander-Linux.zip
88+ echo "$PWD/slc_cli" >> $GITHUB_PATH
89+
90+ - name : Configure SLC-CLI
91+ run : |
92+ slc configuration --sdk simplicity_sdk
93+ slc configuration --gcc-toolchain arm-gnu-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}-x86_64-arm-none-eabi
94+ slc signature trust --sdk simplicity_sdk
95+
96+ # Setup Simplicity Commander
97+ - name : Cache Simplicity Commander
98+ id : cache-simplicity-commander
99+ uses : actions/cache@v4
100+ with :
101+ path : commander
102+ key : simplicity-commander-${{ runner.os }}
103+
104+ - name : Install Simplicity Commander
105+ if : steps.cache-simplicity-commander.outputs.cache-hit != 'true'
106+ run : |
107+ wget -q https://www.silabs.com/documents/login/software/SimplicityCommander-Linux.zip
91108 unzip -q SimplicityCommander-Linux.zip
92109 tar -xf SimplicityCommander-Linux/Commander_linux_x86_64_*.tar.bz
93110
94- - name : Download SLC-CLI
111+ - name : Add Simplicity Commander to PATH
95112 run : |
96- wget -nv https://www.silabs.com/documents/login/software/slc_cli_linux.zip
97- unzip -q slc_cli_linux.zip
113+ echo "$PWD/commander" >> $GITHUB_PATH
98114
99- - name : Build bootloader
115+ # Build bootloader
116+ - name : Generate bootloader project files
117+ working-directory : bootloader
100118 run : |
101- export ARM_GCC_DIR="${{ env.ARM_TOOLCHAIN_PATH }}"
102-
103- cd ${{ env.BOOTLOADER_PATH }}
104- ${{ env.SLC_CLI_PATH }}/slc signature trust --sdk ${{ env.GECKO_SDK_PATH }}
105- ${{ env.SLC_CLI_PATH }}/slc generate -s ${{ env.GECKO_SDK_PATH }} -p bootloader-${{ matrix.board }}.slcp -d bootloader_project -o cmake
119+ slc generate bootloader-${{ matrix.board }}.slcp \
120+ -o cmake \
121+ -d target/${{ matrix.board }}
106122
107- cd bootloader_project/bootloader_cmake
123+ - name : Build bootloader
124+ working-directory : bootloader/target/${{ matrix.board }}/bootloader_cmake
125+ run : |
108126 cmake --workflow --preset project
109- cmake --preset project && cmake --build --preset default_config
127+
128+ # Build firmware
129+ - name : Generate firmware project files
130+ working-directory : firmware
131+ run : |
132+ slc generate wavephoenix.slcp \
133+ --with "${{ matrix.board }};wavephoenix" \
134+ --sdk-extensions=.,libjoybus,libwavebird \
135+ -o cmake \
136+ -d target/${{ matrix.board }}
110137
111138 - name : Build firmware
139+ working-directory : firmware/target/${{ matrix.board }}/wavephoenix_cmake
112140 run : |
113- cd ${{ env.FIRMWARE_PATH }}
114- cmake --preset ${{ matrix.board }} && cmake --build --preset ${{ matrix.board }}
141+ cmake --workflow --preset project
115142
116- - name : Update trunk tag
117- if : github.ref == 'refs/heads/main'
143+ - name : Generate firmware .gbl
144+ working-directory : firmware/target/${{ matrix.board }}/wavephoenix_cmake/build/default_config
118145 run : |
119- cd ${{ env.REPO_PATH }}
120- git tag -f trunk
121- git push -f origin trunk
122- env :
123- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
146+ commander gbl create \
147+ --app wavephoenix.s37 \
148+ wavephoenix.gbl
149+
150+ # - name: Update trunk tag
151+ # if: github.ref == 'refs/heads/main'
152+ # run: |
153+ # cd ${{ env.REPO_PATH }}
154+ # git tag -f trunk
155+ # git push -f origin trunk
156+ # env:
157+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124158
125159 - name : Rename artifacts
126160 run : |
@@ -130,9 +164,8 @@ jobs:
130164 VERSION="trunk"
131165 fi
132166
133- mv ${{ env.BOOTLOADER_PATH }}/bootloader_project/bootloader_cmake/build/default_config/bootloader.hex "wavephoenix-bootloader-${VERSION}-${{ matrix.board }}.hex"
134- mv ${{ env.FIRMWARE_PATH }}/build/${{ matrix.board }}/receiver/receiver.hex "wavephoenix-receiver-${VERSION}-${{ matrix.board }}.hex"
135- mv ${{ env.FIRMWARE_PATH }}/build/${{ matrix.board }}/receiver/receiver.gbl "wavephoenix-receiver-${VERSION}-${{ matrix.board }}.gbl"
167+ mv bootloader/target/${{ matrix.board }}/bootloader_cmake/build/default_config/bootloader.hex "wavephoenix-bootloader-${VERSION}-${{ matrix.board }}.hex"
168+ mv firmware/target/${{ matrix.board }}/wavephoenix_cmake/build/default_config/wavephoenix.hex "wavephoenix-receiver-${VERSION}-${{ matrix.board }}.hex"
136169
137170 - name : Upload artifacts to trunk release
138171 if : github.ref == 'refs/heads/main'
@@ -141,7 +174,6 @@ jobs:
141174 files : |
142175 wavephoenix-bootloader-*.hex
143176 wavephoenix-receiver-*.hex
144- wavephoenix-receiver-*.gbl
145177 tag_name : trunk
146178 name : Trunk Builds
147179 body : Automated build from main branch, not guaranteed to be stable.
@@ -156,7 +188,6 @@ jobs:
156188 files : |
157189 wavephoenix-bootloader-*.hex
158190 wavephoenix-receiver-*.hex
159- wavephoenix-receiver-*.gbl
160191 tag_name : ${{ github.ref }}
161192 name : ${{ github.ref_name }}
162193 draft : true
0 commit comments