air101.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: air101
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/air101.yml'
  6. - 'lua/**'
  7. - 'luat/**'
  8. - 'components/**'
  9. - 'bsp/air101/**'
  10. workflow_dispatch:
  11. repository_dispatch:
  12. types:
  13. - webhook-101-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 update
  26. sudo apt install xmake
  27. - name: clone 101
  28. run: |
  29. sudo sh -c "curl https://raw.githubusercontent.com/kadwanev/retry/master/retry -o /usr/local/bin/retry && chmod +x /usr/local/bin/retry"
  30. cd ..
  31. retry 'git clone --branch=master https://gitee.com/openLuat/luatos-soc-air101 air101'
  32. - name: make
  33. run: |
  34. cd ../air101
  35. gcc -o tools/xt804/wm_tool tools/xt804/wm_tool.c -pthread
  36. chmod +x tools/xt804/wm_tool
  37. mkdir /home/runner/toolchains
  38. wget -q https://github.com/openLuat/LuatOS/releases/download/v0.0.1/csky-elfabiv2-tools-x86_64-minilibc-20210423.tar.gz -O /home/runner/toolchains/csky-elfabiv2-tools-x86_64-minilibc-20210423.tar.gz
  39. xmake g --pkg_searchdirs=/home/runner/toolchains
  40. xmake -y
  41. mkdir ../LuatOS/luatosfw
  42. mv build/out/*.soc ../LuatOS/luatosfw
  43. - name: Upload artifact
  44. uses: actions/upload-artifact@v1
  45. with:
  46. name: air101
  47. path: luatosfw
  48. - name: report if failure
  49. if: always()
  50. env:
  51. STATUS: ${{ job.status }}
  52. MQTTADDR: ${{ secrets.MQTTADDR }}
  53. MQTTPORT: ${{ secrets.MQTTPORT }}
  54. MQTTTOPIC: ${{ secrets.MQTTTOPIC }}
  55. DD_APPKEY: ${{ secrets.DD_APPKEY }}
  56. DD_APPSECRET: ${{ secrets.DD_APPSECRET }}
  57. DD_NOTIFY_LIST: ${{ secrets.DD_NOTIFY_LIST }}
  58. DD_API_TOKEN: ${{ secrets.DD_API_TOKEN }}
  59. DD_API_SEND: ${{ secrets.DD_API_SEND }}
  60. run: |
  61. sudo pip3 install paho_mqtt gitpython requests
  62. cd tools
  63. if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID" "air101" "$DD_APPKEY" "$DD_APPSECRET" "$DD_NOTIFY_LIST" "$DD_API_TOKEN" "$DD_API_SEND"; fi