air780.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: air780
  2. on:
  3. push:
  4. paths:
  5. - '.github/workflows/air780.yml'
  6. - 'lua/**'
  7. - 'luat/**'
  8. - 'components/**'
  9. - 'bsp/air780/**'
  10. workflow_dispatch:
  11. repository_dispatch:
  12. types:
  13. - webhook-780-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 780
  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. git clone https://github.com/openLuat/luatos-soc-2022.git air780
  31. cd air780
  32. git remote add gitee https://gitee.com/openLuat/luatos-soc-2022.git
  33. retry 'git pull gitee master'
  34. git checkout gitee/master
  35. - name: make
  36. run: |
  37. cd ../air780
  38. sed -i 's/os.exec(cmd)/if 1 then return end/g' xmake.lua
  39. export PROJECT_NAME="luatos"
  40. export LSPD_MODE=enable
  41. mkdir /home/runner/toolchains
  42. 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
  43. xmake g --pkg_searchdirs=/home/runner/toolchains
  44. xmake -y
  45. mkdir ../LuatOS/luatosfw
  46. mv out/luatos/* ../LuatOS/luatosfw
  47. - name: Upload artifact
  48. uses: actions/upload-artifact@v4
  49. with:
  50. name: air780
  51. path: luatosfw
  52. - name: report if failure
  53. if: always()
  54. env:
  55. STATUS: ${{ job.status }}
  56. MQTTADDR: ${{ secrets.MQTTADDR }}
  57. MQTTPORT: ${{ secrets.MQTTPORT }}
  58. MQTTTOPIC: ${{ secrets.MQTTTOPIC }}
  59. DD_APPKEY: ${{ secrets.DD_APPKEY }}
  60. DD_APPSECRET: ${{ secrets.DD_APPSECRET }}
  61. DD_NOTIFY_LIST: ${{ secrets.DD_NOTIFY_LIST }}
  62. DD_API_TOKEN: ${{ secrets.DD_API_TOKEN }}
  63. DD_API_SEND: ${{ secrets.DD_API_SEND }}
  64. run: |
  65. sudo pip3 install paho_mqtt gitpython requests
  66. cd tools
  67. if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID" "air780" "$DD_APPKEY" "$DD_APPSECRET" "$DD_NOTIFY_LIST" "$DD_API_TOKEN" "$DD_API_SEND"; fi