build.mac.yml 1.6 KB

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