build.mac.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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
  28. ls -la dist/.env || (echo "ENV file not found!" && exit 1)
  29. cat dist/.env | head -n 1 || (echo "Cannot read ENV file!" && exit 1)
  30. - name: Upload MacOS ARM artifact
  31. uses: actions/upload-artifact@v4
  32. with:
  33. name: CursorPro-MacOS-ARM64
  34. path: |
  35. dist/CursorPro
  36. dist/.env
  37. create-release:
  38. needs: [build-macos-arm64]
  39. runs-on: ubuntu-22.04
  40. if: startsWith(github.ref, 'refs/tags/')
  41. steps:
  42. - name: Download all artifacts
  43. uses: actions/download-artifact@v4
  44. with:
  45. path: artifacts
  46. - name: Create release archives
  47. run: |
  48. cd artifacts
  49. zip -r CursorPro-MacOS-ARM64.zip CursorPro-MacOS-ARM64/
  50. - name: Create Release
  51. uses: softprops/action-gh-release@v1
  52. with:
  53. files: |
  54. artifacts/CursorPro-MacOS-ARM64.zip
  55. env:
  56. GITHUB_TOKEN: ${{ secrets.TOKEN }}