build.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. MACOSX_DEPLOYMENT_TARGET: "10.15"
  65. SYSTEM_VERSION_COMPAT: "1"
  66. run: |
  67. pyinstaller CursorKeepAlive.spec
  68. - name: Upload MacOS x86 artifact
  69. uses: actions/upload-artifact@v4
  70. with:
  71. name: CursorPro-MacOS-x86_64
  72. path: dist/CursorPro
  73. build-linux:
  74. runs-on: ubuntu-latest
  75. steps:
  76. - uses: actions/checkout@v2
  77. - name: Set up Python
  78. uses: actions/setup-python@v2
  79. with:
  80. python-version: '3.x'
  81. - name: Install dependencies
  82. run: |
  83. python -m pip install --upgrade pip
  84. pip install pyinstaller
  85. pip install -r requirements.txt
  86. - name: Build Linux executable
  87. run: |
  88. pyinstaller CursorKeepAlive.spec
  89. - name: Upload Linux artifact
  90. uses: actions/upload-artifact@v4
  91. with:
  92. name: CursorPro-Linux
  93. path: dist/CursorPro