diff --git a/scripts/publish-gitea.ps1 b/scripts/publish-gitea.ps1 index 0d6f1f3..c9f9d4a 100644 --- a/scripts/publish-gitea.ps1 +++ b/scripts/publish-gitea.ps1 @@ -79,7 +79,9 @@ if (Test-Path -LiteralPath $sums) { $uploads += Get-Item -LiteralPath $sums } # 但放在同一个 Release 里,用户在一个页面就能拿到全部形态。 $setup = Get-ChildItem -LiteralPath $Dir -Filter "*-setup-*.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 $portable = Get-ChildItem -LiteralPath $Dir -Filter "*-portable*.zip" -ErrorAction SilentlyContinue | Select-Object -First 1 -$dist = @($setup, $portable) | Where-Object { $_ } +# install.ps1 由 mygo 生成(完整构建才有):一键安装脚本,正文里也给出它的用法。 +$install = Get-ChildItem -LiteralPath $Dir -Filter "install.ps1" -ErrorAction SilentlyContinue | Select-Object -First 1 +$dist = @($setup, $portable, $install) | Where-Object { $_ } function Get-Release { $code = & curl.exe -sS -o NUL -w "%{http_code}" -H "Authorization: token $Token" "$api/releases/tags/$Tag" @@ -102,6 +104,9 @@ if ($portable) { $bodyLines += ('- 便携版 `{0}`:解压到任意目录,双击 ZerOriginTool.exe 运行,配置写在 exe 同目录。' -f $portable.Name) } $bodyLines += ('- 自更新包 `{0}` + `{1}`:程序内托盘菜单「检查更新…」自动使用,无需手动下载。' -f $archiveName, $manifest.Name) +if ($install) { + $bodyLines += ('- 一键安装(当前用户,PowerShell):`irm {0}/{1}/{2}/releases/download/{3}/install.ps1 | iex`' -f $BaseUrl, $Owner, $Repo, $Tag) +} $bodyLines += @("", "本 Release 的附件目录就是客户端检查更新用的 updates.url,请不要删除或改名其中的附件。") $releaseBody = $bodyLines -join "`n"