From 5ce86b0f5cc320d0178834e69ec196770f11ba87 Mon Sep 17 00:00:00 2001 From: WuYongJie Date: Fri, 10 Jul 2026 14:07:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=8F=91=E5=B8=83):=20=E5=B8=B8=E8=A7=84?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E8=B7=B3=E8=BF=87=E4=B8=8B=E8=BD=BD=E4=BA=A7?= =?UTF-8?q?=E7=89=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/publish-to-server.ps1 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/publish-to-server.ps1 b/scripts/publish-to-server.ps1 index 6866ace..cc5692f 100644 --- a/scripts/publish-to-server.ps1 +++ b/scripts/publish-to-server.ps1 @@ -7,6 +7,7 @@ param( [switch]$SkipDeploy, [switch]$SkipBackup, [switch]$AllowDirty, + [switch]$IncludeDownloadArtifacts, [switch]$DryRun ) @@ -26,7 +27,6 @@ $expectedRemoteArchive = "/tmp/equipment-management-release.tar.gz" $releasePaths = @( "backend", "frontend", - "downloads", "scripts/backup-equipment.sh", ".env.example", "AGENTS.md", @@ -37,6 +37,10 @@ $releasePaths = @( "docker-compose.yml" ) +if ($IncludeDownloadArtifacts) { + $releasePaths += "downloads" +} + function Get-CommandPath([string]$name) { $cmd = Get-Command $name -ErrorAction SilentlyContinue if (-not $cmd) { @@ -175,7 +179,11 @@ if ($files.Count -eq 0) { throw "No files matched the release allowlist." } -$artifactFiles = @(Get-DownloadArtifactFiles $projectRoot) +$artifactFiles = if ($IncludeDownloadArtifacts) { + @(Get-DownloadArtifactFiles $projectRoot) +} else { + @() +} $files = @(($files + $artifactFiles) | Sort-Object -Unique) $missingFiles = @($files | Where-Object { -not (Test-Path -LiteralPath $_ -PathType Leaf) }) @@ -197,6 +205,7 @@ Write-Host " Git commit: $commitId" Write-Host " File count: $($files.Count)" Write-Host " Source size: $([math]::Round($totalBytes / 1MB, 2)) MiB" Write-Host " Download artifacts: $($artifactFiles.Count)" +Write-Host " Include download artifacts: $([bool]$IncludeDownloadArtifacts)" Write-Host " Allowlist: $($releasePaths -join ', ')" if ($DryRun) {