From 1fa7d85c468ec885c6d26d5cd9dcec83c3b87b61 Mon Sep 17 00:00:00 2001 From: LoveLosita <2810873701@qq.com> Date: Sat, 9 May 2026 19:22:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=AD=A3=E7=A6=BB?= =?UTF-8?q?=E7=BA=BF=E5=8F=91=E5=B8=83=E8=84=9A=E6=9C=AC=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/release-offline.yml | 1 + deploy/stage-release.ps1 | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/.gitea/workflows/release-offline.yml b/.gitea/workflows/release-offline.yml index c343f07..77e7c89 100644 --- a/.gitea/workflows/release-offline.yml +++ b/.gitea/workflows/release-offline.yml @@ -190,6 +190,7 @@ jobs: "rm -rf `"`$target`"", "mkdir -p `"`$target`"", "tar -xzf `"`$archive`" -C `"`$target`"", + "find `"`$target/deploy`" -maxdepth 1 -type f -name '*.sh' -exec chmod 755 {} +", "rm -f `"`$archive`"" ) -join "`n" diff --git a/deploy/stage-release.ps1 b/deploy/stage-release.ps1 index efa8d04..3bd449a 100644 --- a/deploy/stage-release.ps1 +++ b/deploy/stage-release.ps1 @@ -11,6 +11,15 @@ param( $ErrorActionPreference = "Stop" Set-StrictMode -Version Latest +function Convert-FileToUtf8Lf { + param([string]$Path) + + $content = [System.IO.File]::ReadAllText($Path) + $normalized = $content.Replace("`r`n", "`n") + $utf8NoBom = [System.Text.UTF8Encoding]::new($false) + [System.IO.File]::WriteAllText($Path, $normalized, $utf8NoBom) +} + $repoRoot = Split-Path -Parent $PSScriptRoot $releaseAbs = Join-Path $repoRoot $ReleaseDir $bundleAbs = Join-Path $repoRoot $BundleDir @@ -38,6 +47,17 @@ Copy-Item -LiteralPath (Join-Path $repoRoot "deploy\nginx\default.conf") -Destin Copy-Item -LiteralPath (Join-Path $repoRoot "deploy\certs\README.md") -Destination (Join-Path $releaseAbs "deploy\certs\README.md") Copy-Item -LiteralPath $PlanFile -Destination (Join-Path $releaseAbs "deploy\release-plan.env") +$shellScripts = @( + (Join-Path $releaseAbs "deploy\docker-load.sh"), + (Join-Path $releaseAbs "deploy\project-release.sh"), + (Join-Path $releaseAbs "deploy\project-rollback.sh"), + (Join-Path $releaseAbs "deploy\impact-rules.sh"), + (Join-Path $releaseAbs "deploy\service-catalog.sh") +) +foreach ($scriptPath in $shellScripts) { + Convert-FileToUtf8Lf -Path $scriptPath +} + if (Test-Path -LiteralPath $bundleAbs) { $bundles = Get-ChildItem -LiteralPath $bundleAbs -Filter "*.tar" -File foreach ($bundle in $bundles) {