build.mac.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: Build Mac ARM Executable
  2. on:
  3. push:
  4. branches:
  5. - main
  6. tags:
  7. - 'v*'
  8. jobs:
  9. build-macos-arm64:
  10. runs-on: macos-latest
  11. steps:
  12. - uses: actions/checkout@v2
  13. - name: Set up Python
  14. uses: actions/setup-python@v2
  15. with:
  16. python-version: '3.x'
  17. - name: Install dependencies
  18. run: |
  19. python -m pip install --upgrade pip
  20. pip install pyinstaller
  21. pip install -r requirements.txt
  22. - name: Build MacOS ARM executable
  23. run: |
  24. pyinstaller CursorKeepAlive.spec
  25. - name: Copy and rename env file
  26. run: |
  27. cp .env.example dist/.env.example
  28. ls -la dist/.env.example || (echo "ENV file not found!" && exit 1)
  29. cat dist/.env.example | head -n 1 || (echo "Cannot read ENV file!" && exit 1)
  30. - name: List dist directory contents
  31. run: ls -la dist/
  32. - name: Upload MacOS ARM artifact
  33. uses: actions/upload-artifact@v4
  34. with:
  35. name: CursorPro-MacOS-ARM64
  36. path: |
  37. dist/CursorPro
  38. dist/.env.example
  39. create-release:
  40. needs: [build-macos-arm64]
  41. runs-on: ubuntu-22.04
  42. if: startsWith(github.ref, 'refs/tags/')
  43. steps:
  44. - name: Download all artifacts
  45. uses: actions/download-artifact@v4
  46. with:
  47. path: artifacts
  48. - name: Create release archives
  49. run: |
  50. cd artifacts
  51. zip -r CursorPro-MacOS-ARM64.zip CursorPro-MacOS-ARM64/
  52. - name: Create Release
  53. uses: softprops/action-gh-release@v1
  54. with:
  55. files: |
  56. artifacts/CursorPro-MacOS-ARM64.zip
  57. env:
  58. GITHUB_TOKEN: ${{ secrets.TOKEN }}