name: Build Executables on: push: tags: - 'v*' workflow_dispatch: inputs: version: description: 'Version number (without v prefix)' required: true default: '1.0.0' permissions: contents: write actions: write packages: write jobs: build-windows: runs-on: windows-latest steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.x' - name: Get version shell: bash run: | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV else echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV fi - name: Install dependencies run: | python -m pip install --upgrade pip pip install pyinstaller pip install -r requirements.txt - name: Build EXE run: | pyinstaller build.spec - name: Rename artifact shell: bash run: | mv dist/*.exe "dist/CursorFreeVIP_${VERSION}_windows.exe" - name: Upload Windows artifact uses: actions/upload-artifact@v4 with: name: CursorFreeVIP-Windows path: dist/CursorFreeVIP_*_windows.exe build-macos-arm64: runs-on: macos-latest steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install pyinstaller pip install -r requirements.txt - name: Build MacOS ARM executable run: | pyinstaller build.spec - name: Upload MacOS ARM artifact uses: actions/upload-artifact@v4 with: name: CursorFreeVIP-MacOS-ARM64 path: dist/* build-linux: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install pyinstaller pip install -r requirements.txt - name: Build Linux executable run: | pyinstaller build.spec - name: Upload Linux artifact uses: actions/upload-artifact@v4 with: name: CursorFreeVIP-Linux path: dist/* build-macos-intel: runs-on: macos-latest steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.x' - name: Install dependencies run: | arch -x86_64 pip3 install --upgrade pip arch -x86_64 pip3 install pyinstaller arch -x86_64 pip3 install -r requirements.txt - name: Build MacOS Intel executable env: TARGET_ARCH: 'x86_64' run: | arch -x86_64 python3 -m PyInstaller build.spec - name: Upload MacOS Intel artifact uses: actions/upload-artifact@v4 with: name: CursorFreeVIP-MacOS-Intel path: dist/* create-release: needs: [build-windows, build-macos-arm64, build-linux, build-macos-intel] runs-on: ubuntu-22.04 steps: - name: Get version shell: bash run: | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV else echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV fi - name: Download all artifacts uses: actions/download-artifact@v4 with: path: artifacts - name: Prepare release files run: | cd artifacts mv CursorFreeVIP-Windows/* . mv CursorFreeVIP-MacOS-ARM64/* . mv CursorFreeVIP-Linux/* . mv CursorFreeVIP-MacOS-Intel/* . rm -rf CursorFreeVIP-*/ - name: Create Release uses: softprops/action-gh-release@v1 with: files: | artifacts/CursorFreeVIP_${VERSION}_windows.exe artifacts/CursorFreeVIP_${VERSION}_mac_arm64 artifacts/CursorFreeVIP_${VERSION}_linux artifacts/CursorFreeVIP_${VERSION}_mac_intel draft: false prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}