build.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: Build
  2. on:
  3. push:
  4. branches:
  5. - main
  6. jobs:
  7. compile:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Check out repository
  11. uses: actions/checkout@v4
  12. - name: Set up Arduino CLI
  13. uses: arduino/setup-arduino-cli@v2
  14. - name: Set up Python
  15. uses: actions/setup-python@v5
  16. with:
  17. python-version: '3.x'
  18. - name: Install adafruit-nrfutil
  19. # The Adafruit nRF52 build recipe shells out to adafruit-nrfutil to
  20. # package the DFU .zip; it is not bundled with the core on the runner.
  21. run: pip install adafruit-nrfutil
  22. - name: Install Adafruit nRF52 core
  23. run: |
  24. arduino-cli config init --overwrite
  25. arduino-cli config set board_manager.additional_urls https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
  26. arduino-cli core update-index
  27. arduino-cli core install adafruit:nrf52
  28. - name: Generate version header
  29. run: ./gen_version.sh
  30. - name: Compile OpenPuck
  31. run: |
  32. mkdir -p build/openpuck build/cache/openpuck
  33. arduino-cli compile \
  34. -b adafruit:nrf52:feather52840 \
  35. --clean \
  36. --build-path build/cache/openpuck \
  37. --output-dir build/openpuck \
  38. --build-property "build.extra_flags=-DNRF52840_XXAA {build.flags.usb} -DCFG_TUD_HID=4" \
  39. OpenPuck
  40. - name: List build outputs
  41. run: |
  42. find build/openpuck -maxdepth 1 -type f -print | sort
  43. - name: Upload build artifacts
  44. uses: actions/upload-artifact@v4
  45. with:
  46. name: openpuck-firmware
  47. retention-days: 7
  48. path: |
  49. build/openpuck/*.uf2
  50. build/openpuck/*.bin
  51. build/openpuck/*.hex
  52. build/openpuck/*.elf
  53. build/openpuck/*.map
  54. build/openpuck/*.zip