build.yaml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: build
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - dev
  7. jobs:
  8. task:
  9. runs-on: ${{ matrix.os }}
  10. strategy:
  11. matrix:
  12. os: [windows-latest, macOS-latest, ubuntu-latest]
  13. node-version: [18.x]
  14. npm-client: [npm, yarn, pnpm]
  15. steps:
  16. - uses: pnpm/action-setup@v2
  17. if: matrix.npm-client == 'pnpm'
  18. name: Install pnpm
  19. with:
  20. version: 7
  21. run_install: false
  22. - name: Set up Node.js ${{ matrix.node-version }}
  23. uses: actions/setup-node@v4
  24. with:
  25. node-version: ${{ matrix.node-version }}
  26. - name: Check out code
  27. uses: actions/checkout@v4
  28. - name: Install dependencies
  29. run: ${{ matrix.npm-client }} install
  30. - name: Build
  31. run: ${{ matrix.npm-client }} run build
  32. - name: Notify failure
  33. if: ${{ failure() }}
  34. env:
  35. QYWX_ROBOT_URL: ${{ secrets.QYWX_ROBOT_URL }}
  36. run: |
  37. curl -H "Content-Type: application/json" -X POST -d '{
  38. "msgtype": "text",
  39. "text": {
  40. "content": "UI 编译任务任务执行失败,请检查!https://github.com/pig-mesh/pig-ui"
  41. }
  42. }' $QYWX_ROBOT_URL