repo-dispatcher.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #=================================================
  2. # https://github.com/P3TERX/Actions-OpenWrt
  3. # Description: Build OpenWrt using GitHub Actions
  4. # Lisence: MIT
  5. # Author: P3TERX
  6. # Blog: https://p3terx.com
  7. #=================================================
  8. name: Repo Dispatcher
  9. on:
  10. # push:
  11. # branches:
  12. # - master
  13. #schedule:
  14. # - cron: 30 18 * * *
  15. workflow_dispatch:
  16. inputs:
  17. version:
  18. description: 'Version'
  19. required: false
  20. default: ''
  21. env:
  22. REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
  23. TZ: Asia/Shanghai
  24. jobs:
  25. build:
  26. runs-on: Ubuntu-20.04
  27. steps:
  28. - name: cancel running workflows
  29. uses: styfle/cancel-workflow-action@main
  30. with:
  31. workflow_id: Openwrt-AutoBuild.yml,repo-dispatcher.yml
  32. access_token: ${{ github.token }}
  33. - name: Checkout
  34. uses: actions/checkout@main
  35. - name: Load Settings.ini
  36. run: |
  37. source "${GITHUB_WORKSPACE}/devices/common/settings.ini"
  38. if [ -f "devices/${{matrix.target}}/settings.ini" ]; then
  39. source "${GITHUB_WORKSPACE}/devices/${{matrix.target}}/settings.ini"
  40. fi
  41. echo "REPO_URL=${REPO_URL}" >> $GITHUB_ENV
  42. echo "REPO_BRANCH=${REPO_BRANCH}" >> $GITHUB_ENV
  43. - name: Trigger Compile
  44. run: |
  45. sudo timedatectl set-timezone "$TZ"
  46. curl \
  47. -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
  48. -H "Accept: application/vnd.github.everest-preview+json" \
  49. -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
  50. -d '{"event_type": "x86_64 ${{ github.event.inputs.version }}", "client_payload": {"target": "x86_64"}}'
  51. curl \
  52. -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
  53. -H "Accept: application/vnd.github.everest-preview+json" \
  54. -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
  55. -d '{"event_type": "nanopi-r2s ${{ github.event.inputs.version }}", "client_payload": {"target": "nanopi-r2s"}}'
  56. curl \
  57. -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
  58. -H "Accept: application/vnd.github.everest-preview+json" \
  59. -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
  60. -d '{"event_type": "Rpi-4B ${{ github.event.inputs.version }}", "client_payload": {"target": "Rpi-4B"}}'
  61. curl \
  62. -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
  63. -H "Accept: application/vnd.github.everest-preview+json" \
  64. -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
  65. -d '{"event_type": "phicomm-N1 ${{ github.event.inputs.version }}", "client_payload": {"target": "phicomm-N1"}}'