feat: 修改 workflow
This commit is contained in:
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@@ -2,6 +2,8 @@ name: Build Executables
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
tags:
|
tags:
|
||||||
- 'v*' # 添加标签触发条件,匹配 v1.0.0 这样的标签
|
- 'v*' # 添加标签触发条件,匹配 v1.0.0 这样的标签
|
||||||
|
|
||||||
@@ -61,7 +63,7 @@ jobs:
|
|||||||
path: dist/CursorPro
|
path: dist/CursorPro
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -89,7 +91,7 @@ jobs:
|
|||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
needs: [build-windows, build-macos-arm64, build-linux]
|
needs: [build-windows, build-macos-arm64, build-linux]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -98,15 +100,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
- name: Create release archives
|
||||||
run: ls -R artifacts
|
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
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
artifacts/CursorPro-Windows/CursorPro.exe
|
artifacts/CursorPro-Windows.zip
|
||||||
artifacts/CursorPro-MacOS-ARM64/CursorPro
|
artifacts/CursorPro-MacOS-ARM64.zip
|
||||||
artifacts/CursorPro-Linux/CursorPro
|
artifacts/CursorPro-Linux.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||||
14
README.md
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方式:
|
|
||||||
右键选择以管理员权限运行就行。
|
|
||||||
|
|
||||||
|
|
||||||
仓库源码来自开源;自行优化了验证和邮箱注册逻辑;解决了无法获取邮箱验证码的问题。
|
仓库源码来自开源;自行优化了验证和邮箱注册逻辑;解决了无法获取邮箱验证码的问题。
|
||||||
42
build.py
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()
|
|
||||||
Reference in New Issue
Block a user