From 3d4188832705e03f12900392972b7124eebae73a Mon Sep 17 00:00:00 2001 From: zerorigin2019 Date: Mon, 16 Nov 2026 10:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=84=9A=E6=9C=AC=EF=BC=9A?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E4=B8=8A=E4=BC=A0=20install.ps1=20=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/publish-gitea.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"