build.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. name: Build Executables
  2. on:
  3. push:
  4. branches: [ "main", "master" ] # 只在主分支推送时触发
  5. jobs:
  6. build-windows:
  7. runs-on: windows-latest
  8. steps:
  9. - uses: actions/checkout@v2
  10. - name: Set up Python
  11. uses: actions/setup-python@v2
  12. with:
  13. python-version: '3.x'
  14. - name: Install dependencies
  15. run: |
  16. python -m pip install --upgrade pip
  17. pip install pyinstaller
  18. pip install -r requirements.txt
  19. - name: Build EXE
  20. run: |
  21. pyinstaller CursorKeepAlive.spec
  22. - name: Upload Windows artifact
  23. uses: actions/upload-artifact@v4
  24. with:
  25. name: CursorPro-Windows
  26. path: dist/CursorPro.exe
  27. build-macos-arm64:
  28. runs-on: macos-latest
  29. steps:
  30. - uses: actions/checkout@v2
  31. - name: Set up Python
  32. uses: actions/setup-python@v2
  33. with:
  34. python-version: '3.x'
  35. - name: Install dependencies
  36. run: |
  37. python -m pip install --upgrade pip
  38. pip install pyinstaller
  39. pip install -r requirements.txt
  40. - name: Build MacOS ARM executable
  41. run: |
  42. pyinstaller CursorKeepAlive.spec
  43. - name: Upload MacOS ARM artifact
  44. uses: actions/upload-artifact@v4
  45. with:
  46. name: CursorPro-MacOS-ARM64
  47. path: dist/CursorPro
  48. build-macos-x86:
  49. runs-on: macos-latest
  50. steps:
  51. - uses: actions/checkout@v2
  52. - name: Set up Python
  53. uses: actions/setup-python@v2
  54. with:
  55. python-version: '3.x'
  56. - name: Install dependencies
  57. run: |
  58. python -m pip install --upgrade pip
  59. pip install pyinstaller
  60. pip install -r requirements.txt
  61. - name: Build MacOS x86 executable
  62. env:
  63. ARCHFLAGS: "-arch x86_64"
  64. run: |
  65. pyinstaller --target-arch x86_64 CursorKeepAlive.spec
  66. - name: Upload MacOS x86 artifact
  67. uses: actions/upload-artifact@v4
  68. with:
  69. name: CursorPro-MacOS-x86_64
  70. path: dist/CursorPro
  71. build-linux:
  72. runs-on: ubuntu-latest
  73. steps:
  74. - uses: actions/checkout@v2
  75. - name: Set up Python
  76. uses: actions/setup-python@v2
  77. with:
  78. python-version: '3.x'
  79. - name: Install dependencies
  80. run: |
  81. python -m pip install --upgrade pip
  82. pip install pyinstaller
  83. pip install -r requirements.txt
  84. - name: Build Linux executable
  85. run: |
  86. pyinstaller CursorKeepAlive.spec
  87. - name: Upload Linux artifact
  88. uses: actions/upload-artifact@v4
  89. with:
  90. name: CursorPro-Linux
  91. path: dist/CursorPro