name: Build firmware on: push: branches: - "**" workflow_dispatch: env: PICO_SDK_REF: 2.2.0 TINYUSB_REF: 0.20.0 PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk jobs: build: name: Build UF2 artifacts runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive - name: Install build dependencies run: | sudo apt update sudo apt install -y cmake python3 build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib ninja-build - name: Download Pico SDK run: | git clone --depth 1 --branch "$PICO_SDK_REF" https://github.com/raspberrypi/pico-sdk.git "$PICO_SDK_PATH" git -C "$PICO_SDK_PATH" submodule update --init --recursive - name: Switch TinyUSB to configured tag run: | if ! git -C "$PICO_SDK_PATH/lib/tinyusb" rev-parse -q --verify "refs/tags/$TINYUSB_REF" >/dev/null; then git -C "$PICO_SDK_PATH/lib/tinyusb" fetch --depth 1 origin "refs/tags/$TINYUSB_REF:refs/tags/$TINYUSB_REF" fi git -C "$PICO_SDK_PATH/lib/tinyusb" checkout --detach "$TINYUSB_REF" - name: Build standard firmware run: | cmake -S . -B build/standard -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DPICO_SDK_PATH="$PICO_SDK_PATH" cmake --build build/standard --target ds5-bridge mkdir -p artifacts cp build/standard/ds5-bridge.uf2 artifacts/ds5-bridge.uf2 - name: Build DSE firmware run: | cmake -S . -B build/dse -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DPICO_SDK_PATH="$PICO_SDK_PATH" \ -DENABLE_DSE=ON cmake --build build/dse --target ds5-bridge cp build/dse/ds5-bridge.uf2 artifacts/ds5-bridge-dse.uf2 - name: Upload standard UF2 artifact uses: actions/upload-artifact@v7 with: path: artifacts/ds5-bridge.uf2 archive: false if-no-files-found: error - name: Upload DSE UF2 artifact uses: actions/upload-artifact@v7 with: path: artifacts/ds5-bridge-dse.uf2 archive: false if-no-files-found: error