build.mac.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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/*
  38. create-release:
  39. needs: [build-macos-arm64]
  40. runs-on: ubuntu-22.04
  41. if: startsWith(github.ref, 'refs/tags/')
  42. steps:
  43. - name: Download all artifacts
  44. uses: actions/download-artifact@v4
  45. with:
  46. path: artifacts
  47. - name: Create release archives
  48. run: |
  49. cd artifacts
  50. zip -r CursorPro-MacOS-ARM64.zip CursorPro-MacOS-ARM64/
  51. - name: Create Release
  52. uses: softprops/action-gh-release@v1
  53. with:
  54. files: |
  55. artifacts/CursorPro-MacOS-ARM64.zip
  56. env:
  57. GITHUB_TOKEN: ${{ secrets.TOKEN }}