Parcourir la source

feat: 修改 workflow

cheng zhen il y a 1 an
Parent
commit
078ae04eff
3 fichiers modifiés avec 13 ajouts et 63 suppressions
  1. 13 7
      .github/workflows/build.yml
  2. 0 14
      README.md
  3. 0 42
      build.py

+ 13 - 7
.github/workflows/build.yml

@@ -2,6 +2,8 @@ name: Build Executables
 
 on:
   push:
+    branches:
+      - main
     tags:
       - 'v*'  # 添加标签触发条件,匹配 v1.0.0 这样的标签
 
@@ -61,7 +63,7 @@ jobs:
         path: dist/CursorPro
 
   build-linux:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-22.04
     
     steps:
     - uses: actions/checkout@v2
@@ -89,7 +91,7 @@ jobs:
 
   create-release:
     needs: [build-windows, build-macos-arm64, build-linux]
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-22.04
     if: startsWith(github.ref, 'refs/tags/')
     
     steps:
@@ -98,15 +100,19 @@ jobs:
         with:
           path: artifacts
           
-      - name: Display structure of downloaded files
-        run: ls -R artifacts
+      - name: Create release archives
+        run: |
+          cd artifacts
+          zip -r CursorPro-Windows.zip CursorPro-Windows/
+          zip -r CursorPro-MacOS-ARM64.zip CursorPro-MacOS-ARM64/
+          zip -r CursorPro-Linux.zip CursorPro-Linux/
           
       - name: Create Release
         uses: softprops/action-gh-release@v1
         with:
           files: |
-            artifacts/CursorPro-Windows/CursorPro.exe
-            artifacts/CursorPro-MacOS-ARM64/CursorPro
-            artifacts/CursorPro-Linux/CursorPro
+            artifacts/CursorPro-Windows.zip
+            artifacts/CursorPro-MacOS-ARM64.zip
+            artifacts/CursorPro-Linux.zip
         env:
           GITHUB_TOKEN: ${{ secrets.TOKEN }}

+ 0 - 14
README.md

@@ -58,19 +58,5 @@ chmod +x ./CursorPro
 ## 免责声明
 本工具仅供学习研究使用,请遵守相关服务条款。使用本工具产生的任何后果由使用者自行承担。
 
-## cursor-id-modifier 使用说明
-> 工具来源 https://github.com/yuaotian/go-cursor-help
-
-下载之后,使用管理员权限运行就行。
-
-mac方式:
-```bash
-chmod +x ./cursor-id-modifier
-sudo ./cursor-id-modifier
-```
-
-windows方式:
-右键选择以管理员权限运行就行。
-
 
 仓库源码来自开源;自行优化了验证和邮箱注册逻辑;解决了无法获取邮箱验证码的问题。

+ 0 - 42
build.py

@@ -1,42 +0,0 @@
-import os
-import platform
-import subprocess
-
-
-def build():
-    system = platform.system().lower()
-    spec_file = "CursorKeepAlive.spec"
-
-    if system not in ["darwin", "windows"]:
-        print(f"不支持的操作系统: {system}")
-        return
-
-    output_dir = f"dist/{system if system != 'darwin' else 'mac'}"
-
-    # 创建输出目录
-    os.makedirs(output_dir, exist_ok=True)
-
-    # 运行 PyInstaller
-    subprocess.run(
-        [
-            "pyinstaller",
-            spec_file,
-            "--distpath",
-            output_dir,
-            "--workpath",
-            f"build/{system}",
-        ]
-    )
-
-    # 复制配置文件
-    if os.path.exists("config.ini.example"):
-        if system == "darwin":
-            subprocess.run(["cp", "config.ini.example", f"{output_dir}/config.ini"])
-        else:
-            subprocess.run(["cp", "config.ini.example", f"{output_dir}/config.ini"])
-
-    print(f"构建完成,输出目录: {output_dir}")
-
-
-if __name__ == "__main__":
-    build()