| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- name: Build
- on:
- push:
- branches:
- - main
- jobs:
- compile:
- runs-on: ubuntu-latest
- steps:
- - name: Check out repository
- uses: actions/checkout@v4
- - name: Set up Arduino CLI
- uses: arduino/setup-arduino-cli@v2
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.x'
- - name: Install adafruit-nrfutil
- # The Adafruit nRF52 build recipe shells out to adafruit-nrfutil to
- # package the DFU .zip; it is not bundled with the core on the runner.
- run: pip install adafruit-nrfutil
- - name: Install Adafruit nRF52 core
- run: |
- arduino-cli config init --overwrite
- arduino-cli config set board_manager.additional_urls https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
- arduino-cli core update-index
- arduino-cli core install adafruit:nrf52
- - name: Generate version header
- run: ./gen_version.sh
- - name: Compile OpenPuck
- run: |
- mkdir -p build/openpuck build/cache/openpuck
- arduino-cli compile \
- -b adafruit:nrf52:feather52840 \
- --clean \
- --build-path build/cache/openpuck \
- --output-dir build/openpuck \
- --build-property "build.extra_flags=-DNRF52840_XXAA {build.flags.usb} -DCFG_TUD_HID=4" \
- OpenPuck
- - name: Generate UF2 image
- run: |
- UF2_FAMILY_ID=0xADA52840
- CORE_DIR="$(find "${HOME}/.arduino15/packages/adafruit/hardware/nrf52" \
- -mindepth 1 -maxdepth 1 -type d | sort -V | tail -n 1)"
- UF2CONV="${CORE_DIR}/tools/uf2conv/uf2conv.py"
- if [ ! -f "${UF2CONV}" ]; then
- echo "UF2 converter not found: ${UF2CONV}"
- exit 1
- fi
- if [ ! -f build/openpuck/OpenPuck.ino.hex ]; then
- echo "HEX output not found: build/openpuck/OpenPuck.ino.hex"
- exit 1
- fi
- python3 "${UF2CONV}" -f "${UF2_FAMILY_ID}" -c \
- -o build/openpuck/OpenPuck.ino.uf2 \
- build/openpuck/OpenPuck.ino.hex
- - name: List build outputs
- run: |
- find build/openpuck -maxdepth 1 -type f -print | sort
- - name: Upload build artifacts
- uses: actions/upload-artifact@v4
- with:
- name: openpuck-firmware
- retention-days: 7
- path: |
- build/openpuck/*.uf2
- build/openpuck/*.bin
- build/openpuck/*.hex
- build/openpuck/*.elf
- build/openpuck/*.map
- build/openpuck/*.zip
|