fix: release workflow permissions #59
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 firmware" | |
| # Run this job on all pushes to master, for pull requests | |
| # as well as tags with a semantic version | |
| on: | |
| push: | |
| branches: | |
| # This avoids having duplicate builds in non-forked PRs | |
| - "master" | |
| tags: | |
| # normal versions | |
| - "v[0-9]+.[0-9]+.[0-9]+" | |
| # pre-releases | |
| - "v[0-9]+.[0-9]+.[0-9]+-**" | |
| pull_request: {} | |
| # Cancel previous PR/branch runs when a new commit is pushed | |
| concurrency: | |
| group: "build-firmware-${{ github.ref }}" | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Download Simplicity SDK | |
| run: | | |
| curl -o simplicity_sdk_2024.12.1.zip -L https://github.com/SiliconLabs/simplicity_sdk/releases/download/v2024.12.1-0/simplicity-sdk.zip \ | |
| && unzip -q -d /opt/simplicity_sdk simplicity_sdk_2024.12.1.zip \ | |
| && rm simplicity_sdk_2024.12.1.zip | |
| - name: Download SLC CLI | |
| run: | | |
| curl -O https://www.silabs.com/documents/login/software/slc_cli_linux.zip \ | |
| && unzip -q -d /opt slc_cli_linux.zip \ | |
| && rm slc_cli_linux.zip | |
| # Install Simplicity Commander (unfortunately no stable URL available, this | |
| # is known to be working with Commander_linux_x86_64_1v15p0b1306.tar.bz). | |
| - name: Download Simplicity Commander | |
| run: | | |
| curl -O https://www.silabs.com/documents/login/software/SimplicityCommander-Linux.zip \ | |
| && unzip -q SimplicityCommander-Linux.zip \ | |
| && tar -C /opt -xjf SimplicityCommander-Linux/Commander_linux_x86_64_*.tar.bz \ | |
| && rm -r SimplicityCommander-Linux \ | |
| && rm SimplicityCommander-Linux.zip | |
| # GCC Embedded Toolchain 12.2.rel1 (for Gecko SDK 4.4.0+) | |
| - name: Download Toolchain | |
| run: | | |
| curl -O https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz \ | |
| && tar -C /opt -xf arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz \ | |
| && rm arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz | |
| - name: Build project | |
| run: tools/build.sh | |
| env: | |
| SDK: /opt/simplicity_sdk | |
| SLC: /opt/slc_cli/slc | |
| COMMANDER: /opt/commander/commander | |
| - name: Upload GBL | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zwa2_controller.gbl | |
| path: artifact/zwa2_controller.gbl | |
| - name: Copy HEX file | |
| run: cp build/release/nc_controller_ncp.hex artifact/zwa2_controller.hex | |
| - name: Upload HEX | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zwa2_controller.hex | |
| path: artifact/zwa2_controller.hex |