Files
DS5Dongle-OLED-Edition-stea…/.github/workflows/build.yml
T
2026-04-29 19:17:17 +08:00

72 lines
2.3 KiB
YAML

name: Build firmware
on:
push:
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: Cache Pico SDK
uses: actions/cache@v4
with:
path: ${{ env.PICO_SDK_PATH }}
key: pico-sdk-${{ runner.os }}-${{ env.PICO_SDK_REF }}-tinyusb-${{ env.TINYUSB_REF }}
- name: Prepare Pico SDK
run: |
if [ ! -d "$PICO_SDK_PATH/.git" ]; then
git clone --depth 1 --branch "$PICO_SDK_REF" https://github.com/raspberrypi/pico-sdk.git "$PICO_SDK_PATH"
fi
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 UF2 artifacts
uses: actions/upload-artifact@v4
with:
name: ds5-bridge-uf2
path: artifacts/*.uf2
if-no-files-found: error