ci.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: CI
  2. on: [push, pull_request]
  3. jobs:
  4. build-ubuntu:
  5. runs-on: ubuntu-22.04
  6. steps:
  7. - uses: actions/checkout@v3
  8. - name: Set environment variables
  9. id: vars
  10. run: |
  11. echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
  12. - name: Dependency packages (apt)
  13. run: |
  14. sudo apt update
  15. sudo apt -y install git gcc-arm-none-eabi python3-pip srecord zip
  16. - name: Dependency packages (pip)
  17. run: python3 -m pip install --user crcmod
  18. - name: Build dist
  19. run: |
  20. export P=greaseweazle-firmware
  21. export V=${{ steps.vars.outputs.sha_short }}
  22. make -j4 dist
  23. mkdir -p _cidist
  24. rm out/$P-*.zip
  25. mv out/$P-* $P-$V
  26. rm $P-$V/RELEASE_NOTES
  27. git rev-parse HEAD >$P-$V/COMMIT
  28. zip -r $P-$V.zip $P-$V
  29. mv $P-$V.zip _cidist/
  30. - name: Build debug dist
  31. run: |
  32. export P=greaseweazle-firmware
  33. export V=${{ steps.vars.outputs.sha_short }}-debug
  34. make -j4 dist level=debug
  35. rm out/$P-*.zip
  36. mv out/$P-* $P-$V
  37. rm $P-$V/RELEASE_NOTES
  38. git rev-parse HEAD >$P-$V/COMMIT
  39. echo debug >>$P-$V/COMMIT
  40. zip -r $P-$V.zip $P-$V
  41. mv $P-$V.zip _cidist/
  42. - name: Upload artifacts
  43. uses: actions/upload-artifact@v3
  44. with:
  45. name: greaseweazle-firmware.ci.${{ steps.vars.outputs.sha_short }}
  46. path: _cidist