4444 - name : Install Tauri CLI
4545 run : cargo install tauri-cli
4646
47- # 构建并发布常规安装包
4847 - name : Build Tauri installer
4948 uses : tauri-apps/tauri-action@v0
5049 env :
@@ -57,30 +56,22 @@ jobs:
5756 prerelease : false
5857 args : --target x86_64-pc-windows-msvc
5958
60- # 构建绿色版本(便携版)
61- - name : Build green version (portable)
62- run : |
63- pnpm run tauri build --target x86_64-pc-windows-msvc
64- # 查看构建输出目录结构
65- ls -R ./src-tauri/target/x86_64-pc-windows-msvc/release/bundle/
59+ - name : Build green version
60+ run : pnpm run tauri build --target x86_64-pc-windows-msvc
6661
67- # 打包绿色版本为ZIP
68- - name : Package green version
62+ - name : Set EXE path
6963 run : |
7064 $version = "${{ github.ref_name }}".Replace('v', '')
71- $greenDir = "./src-tauri/target/x86_64-pc-windows-msvc/release"
72- $zipName = "RandomNum-You-green-$version-windows-x64.zip"
73-
74- # 创建ZIP包(包含所有可执行文件和依赖)
75- Compress-Archive -Path "$greenDir/*" -DestinationPath "$zipName"
76- echo "GREEN_ZIP=$zipName" >> $env:GITHUB_ENV
65+ $exePath = "./src-tauri/target/x86_64-pc-windows-msvc/release/RandomNum-You.exe"
66+ $destName = "RandomNum-You-green-$version-windows-x64.exe"
67+ Copy-Item -Path "$exePath" -Destination "$destName"
68+ echo "EXE_PATH=$destName" >> $env:GITHUB_ENV
7769
78- # 上传绿色版本到GitHub Releases
79- - name : Upload green version to release
70+ - name : Upload green version
8071 uses : softprops/action-gh-release@v2
8172 with :
8273 tag_name : ${{ github.ref_name }}
83- files : ${{ env.GREEN_ZIP }}
74+ files : ${{ env.EXE_PATH }}
8475 name : " Release ${{ github.ref_name }}"
8576 env :
8677 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments