update remake

This commit is contained in:
yeongpin 2025-02-08 22:10:00 +08:00
parent 4166bc5135
commit 8107bede63

View File

@ -1,110 +1,125 @@
name: Build Release name: Build Executables
on: on:
push: push:
tags: tags:
- 'v*' - '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: jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Build
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
chmod +x build.sh
./build.sh
- name: Rename artifact
run: |
VERSION=${GITHUB_REF#refs/tags/v}
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION=${{ github.event.inputs.version }}
fi
mv dist/* "dist/CursorFreeVIP_${VERSION}_linux"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: cursor-linux
path: dist/CursorFreeVIP*
build-windows: build-windows:
name: Build Windows
runs-on: windows-latest runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Build
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
cmd /c build.bat
- name: Rename artifact
shell: bash
run: |
VERSION=${GITHUB_REF#refs/tags/v}
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION=${{ github.event.inputs.version }}
fi
mv dist/*.exe "dist/CursorFreeVIP_${VERSION}_windows.exe"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: cursor-windows
path: dist/CursorFreeVIP*
build-macos:
name: Build MacOS
runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v3 uses: actions/setup-python@v2
with: with:
python-version: '3.10' python-version: '3.x'
- name: Build
- name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install pyinstaller
pip install -r requirements.txt pip install -r requirements.txt
chmod +x build.mac.command
./build.mac.command - name: Build EXE
- name: Rename artifact
run: | run: |
VERSION=${GITHUB_REF#refs/tags/v} pyinstaller build.spec
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION=${{ github.event.inputs.version }} - name: Upload Windows artifact
fi
mv dist/* "dist/CursorFreeVIP_${VERSION}_mac"
- name: Upload Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: cursor-macos name: CursorFreeVIP-Windows
path: dist/CursorFreeVIP* path: dist/CursorFreeVIP.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/CursorFreeVIP
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/CursorFreeVIP
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/CursorFreeVIP
create-release: create-release:
needs: [build-linux, build-windows, build-macos] needs: [build-windows, build-macos-arm64, build-linux, build-macos-intel]
runs-on: ubuntu-latest runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' if: startsWith(github.ref, 'refs/tags/')
steps: steps:
- name: Download all artifacts - name: Download all artifacts
@ -115,18 +130,20 @@ jobs:
- name: Create release archives - name: Create release archives
run: | run: |
cd artifacts cd artifacts
zip -r cursor-linux.zip cursor-linux/ zip -r CursorFreeVIP-Windows.zip CursorFreeVIP-Windows/
zip -r cursor-windows.zip cursor-windows/ zip -r CursorFreeVIP-MacOS-ARM64.zip CursorFreeVIP-MacOS-ARM64/
zip -r cursor-macos.zip cursor-macos/ zip -r CursorFreeVIP-Linux.zip CursorFreeVIP-Linux/
zip -r CursorFreeVIP-MacOS-Intel.zip CursorFreeVIP-MacOS-Intel/
- name: Create Release - name: Create Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
files: | files: |
artifacts/cursor-linux.zip artifacts/CursorFreeVIP-Windows.zip
artifacts/cursor-windows.zip artifacts/CursorFreeVIP-MacOS-ARM64.zip
artifacts/cursor-macos.zip artifacts/CursorFreeVIP-Linux.zip
draft: false artifacts/CursorFreeVIP-MacOS-Intel.zip
prerelease: false
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.TOKEN }}