File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,11 +41,26 @@ jobs:
4141 "NetStatusSharp.exe.manifest",
4242 "NetStatusAPI.dll"
4343 )
44+ $requiredFiles = @(
45+ "NetStatusSharp.exe",
46+ "NetStatusSharp.exe.config",
47+ "NetStatusAPI.dll"
48+ )
4449
4550 New-Item -ItemType Directory -Force -Path $staging | Out-Null
4651
52+ foreach ($file in $requiredFiles) {
53+ $path = Join-Path $releaseDir $file
54+ if (-not (Test-Path $path)) {
55+ throw "Required release file not found: $path"
56+ }
57+ }
58+
4759 foreach ($file in $filesToInclude) {
48- Copy-Item -Path (Join-Path $releaseDir $file) -Destination $staging -Force
60+ $path = Join-Path $releaseDir $file
61+ if (Test-Path $path) {
62+ Copy-Item -Path $path -Destination $staging -Force
63+ }
4964 }
5065
5166 if (Test-Path $asset) {
Original file line number Diff line number Diff line change @@ -48,4 +48,4 @@ NetStatusSharp\bin\Release\NetStatusSharp.exe
4848
4949- Pushes to ` main ` and pull requests trigger an automatic build.
5050- Pushing a tag such as ` v1.0.0 ` triggers an automatic GitHub Release build.
51- - The release ` zip ` includes only the core runtime files required to launch the app.
51+ - The release ` zip ` includes the core runtime files required to launch the app, plus optional runtime files when they exist in the build output .
Original file line number Diff line number Diff line change @@ -57,4 +57,4 @@ NetStatusSharp\bin\Release\NetStatusSharp.exe
5757
5858- 推送到 ` main ` 或提交 Pull Request 时,会自动执行编译检查。
5959- 推送形如 ` v1.0.0 ` 的标签时,会自动编译并发布 GitHub Release。
60- - Release 附带的 ` zip ` 文件只包含运行应用所需的核心文件。
60+ - Release 附带的 ` zip ` 文件只包含运行应用所需的核心文件,并在构建产物存在时附带额外运行相关文件 。
You can’t perform that action at this time.
0 commit comments