Build and Release #78
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: Build and Release | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| paths: ["bootloader/**", "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: | |
| - 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 cmake ninja-build 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 | |
| # 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: bootloader | |
| run: | | |
| slc generate bootloader-${{ matrix.board }}.slcp \ | |
| -o cmake \ | |
| -d target/${{ matrix.board }} | |
| - name: Build bootloader | |
| working-directory: bootloader/target/${{ matrix.board }}/bootloader_cmake | |
| run: | | |
| cmake --workflow --preset project | |
| # Build firmware | |
| - name: Generate firmware project files | |
| working-directory: firmware | |
| run: | | |
| slc generate wavephoenix.slcp \ | |
| --with "${{ matrix.board }};wavephoenix" \ | |
| --sdk-extensions=.,libjoybus,libwavebird \ | |
| -o cmake \ | |
| -d target/${{ matrix.board }} | |
| - name: Build firmware | |
| working-directory: firmware/target/${{ matrix.board }}/wavephoenix_cmake | |
| run: | | |
| cmake --workflow --preset project | |
| - name: Generate firmware .gbl | |
| working-directory: firmware/target/${{ matrix.board }}/wavephoenix_cmake/build/default_config | |
| run: | | |
| commander gbl create \ | |
| --app wavephoenix.s37 \ | |
| wavephoenix.gbl | |
| # - name: Update trunk tag | |
| # if: github.ref == 'refs/heads/main' | |
| # run: | | |
| # cd ${{ env.REPO_PATH }} | |
| # git tag -f trunk | |
| # git push -f origin trunk | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Rename artifacts | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| VERSION=${GITHUB_REF_NAME} | |
| else | |
| VERSION="trunk" | |
| fi | |
| mv bootloader/target/${{ matrix.board }}/bootloader_cmake/build/default_config/bootloader.hex "wavephoenix-bootloader-${VERSION}-${{ matrix.board }}.hex" | |
| mv firmware/target/${{ matrix.board }}/wavephoenix_cmake/build/default_config/wavephoenix.hex "wavephoenix-receiver-${VERSION}-${{ matrix.board }}.hex" | |
| - 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 | |
| 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 | |
| tag_name: ${{ github.ref }} | |
| name: ${{ github.ref_name }} | |
| draft: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |