air105.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: air105
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/air105.yml'
  6. - 'lua/**'
  7. - 'luat/**'
  8. - 'components/**'
  9. - 'bsp/air105/**'
  10. workflow_dispatch:
  11. repository_dispatch:
  12. types:
  13. - webhook-105-action
  14. jobs:
  15. build:
  16. runs-on: ubuntu-20.04
  17. steps:
  18. - uses: actions/checkout@v1
  19. - name: prepare software
  20. run: |
  21. sudo apt-get update
  22. sudo apt-get install git gcc-multilib libc6 libgcc1 libstdc++5 libstdc++6 libsdl-dev p7zip-full -y
  23. sudo apt-get install libncurses5-dev -y
  24. sudo add-apt-repository ppa:xmake-io/xmake -y
  25. sudo apt install xmake -y
  26. - name: clone 105
  27. run: |
  28. sudo sh -c "curl https://raw.githubusercontent.com/kadwanev/retry/master/retry -o /usr/local/bin/retry && chmod +x /usr/local/bin/retry"
  29. cd ..
  30. retry 'git clone --branch=master https://gitee.com/openLuat/luatos-soc-air105.git air105'
  31. - name: make
  32. run: |
  33. cd ../air105
  34. mkdir /home/runner/toolchains
  35. wget -q https://github.com/openLuat/LuatOS/releases/download/v0.0.1/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 -O /home/runner/toolchains/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
  36. xmake g --pkg_searchdirs=/home/runner/toolchains
  37. xmake -y
  38. mkdir ../LuatOS/luatosfw
  39. mv build/out/*.soc ../LuatOS/luatosfw
  40. - name: Upload artifact
  41. uses: actions/upload-artifact@v1
  42. with:
  43. name: air105
  44. path: luatosfw
  45. - name: report if failure
  46. if: always()
  47. env:
  48. STATUS: ${{ job.status }}
  49. MQTTADDR: ${{ secrets.MQTTADDR }}
  50. MQTTPORT: ${{ secrets.MQTTPORT }}
  51. MQTTTOPIC: ${{ secrets.MQTTTOPIC }}
  52. DD_APPKEY: ${{ secrets.DD_APPKEY }}
  53. DD_APPSECRET: ${{ secrets.DD_APPSECRET }}
  54. DD_NOTIFY_LIST: ${{ secrets.DD_NOTIFY_LIST }}
  55. DD_API_TOKEN: ${{ secrets.DD_API_TOKEN }}
  56. DD_API_SEND: ${{ secrets.DD_API_SEND }}
  57. run: |
  58. sudo pip3 install paho_mqtt gitpython requests
  59. cd tools
  60. if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID" "air105" "$DD_APPKEY" "$DD_APPSECRET" "$DD_NOTIFY_LIST" "$DD_API_TOKEN" "$DD_API_SEND"; fi