Compare commits
No commits in common. "main" and "cv1.0.25" have entirely different histories.
|
|
@ -6,7 +6,7 @@ name: deploy-client
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'deploy-cv*.*.*.*'
|
- 'deploy-cv*.*.*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
|
@ -20,10 +20,10 @@ jobs:
|
||||||
Set-StrictMode -Version Latest
|
Set-StrictMode -Version Latest
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
# 从触发标签解析版本号: deploy-cv1.2.3.4 -> 1.2.3.4
|
# 从触发标签解析版本号: deploy-cv1.2.3 -> 1.2.3
|
||||||
$deployTag = '${{ github.ref_name }}'
|
$deployTag = '${{ github.ref_name }}'
|
||||||
if (-not ($deployTag -match '^deploy-cv(\d+\.\d+\.\d+\.\d+)$')) {
|
if (-not ($deployTag -match '^deploy-cv(\d+\.\d+\.\d+)$')) {
|
||||||
throw "Trigger tag '$deployTag' must match deploy-cvx.x.x.x."
|
throw "Trigger tag '$deployTag' must match deploy-cvx.x.x."
|
||||||
}
|
}
|
||||||
$version = $Matches[1]
|
$version = $Matches[1]
|
||||||
|
|
||||||
|
|
@ -104,8 +104,7 @@ jobs:
|
||||||
}
|
}
|
||||||
$innerZipPath = Join-Path -Path $targetDir -ChildPath "HighErpAgent-v$version-deploy.zip"
|
$innerZipPath = Join-Path -Path $targetDir -ChildPath "HighErpAgent-v$version-deploy.zip"
|
||||||
Write-Host "Extracting $assetName -> $targetDir"
|
Write-Host "Extracting $assetName -> $targetDir"
|
||||||
& $sevenZipPath x "$encryptedZipPath" -p"$env:DEPLOY_ZIP_PASSWORD" -o"$targetDir" -aoa *>&1 | Out-Null
|
& $sevenZipPath x "$encryptedZipPath" -p"$env:DEPLOY_ZIP_PASSWORD" -o"$targetDir" -aoa
|
||||||
if ($LASTEXITCODE -ne 0) { throw "7z extraction failed (exit code $LASTEXITCODE)." }
|
|
||||||
|
|
||||||
if (-not (Test-Path -Path $innerZipPath)) { throw "Inner deploy zip not found after extracting '$assetName': '$innerZipPath'." }
|
if (-not (Test-Path -Path $innerZipPath)) { throw "Inner deploy zip not found after extracting '$assetName': '$innerZipPath'." }
|
||||||
Write-Host "Expanding inner zip -> $targetDir"
|
Write-Host "Expanding inner zip -> $targetDir"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ name: deploy-server
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'deploy-sv*.*.*.*'
|
- 'deploy-sv*.*.*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
|
@ -20,10 +20,10 @@ jobs:
|
||||||
Set-StrictMode -Version Latest
|
Set-StrictMode -Version Latest
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
# 从触发标签解析版本号: deploy-sv1.2.3.4 -> 1.2.3.4
|
# 从触发标签解析版本号: deploy-sv1.2.3 -> 1.2.3
|
||||||
$deployTag = '${{ github.ref_name }}'
|
$deployTag = '${{ github.ref_name }}'
|
||||||
if (-not ($deployTag -match '^deploy-sv(\d+\.\d+\.\d+\.\d+)$')) {
|
if (-not ($deployTag -match '^deploy-sv(\d+\.\d+\.\d+)$')) {
|
||||||
throw "Trigger tag '$deployTag' must match deploy-svx.x.x.x."
|
throw "Trigger tag '$deployTag' must match deploy-svx.x.x."
|
||||||
}
|
}
|
||||||
$version = $Matches[1]
|
$version = $Matches[1]
|
||||||
|
|
||||||
|
|
@ -107,8 +107,7 @@ jobs:
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Extracting $assetName -> $deployRoot"
|
Write-Host "Extracting $assetName -> $deployRoot"
|
||||||
& $sevenZipPath x "$encryptedZipPath" -p"$env:DEPLOY_ZIP_PASSWORD" -o"$deployRoot" -aoa *>&1 | Out-Null
|
& $sevenZipPath x "$encryptedZipPath" -p"$env:DEPLOY_ZIP_PASSWORD" -o"$deployRoot" -aoa
|
||||||
if ($LASTEXITCODE -ne 0) { throw "7z extraction failed (exit code $LASTEXITCODE)." }
|
|
||||||
Remove-Item -Path $encryptedZipPath -Force
|
Remove-Item -Path $encryptedZipPath -Force
|
||||||
|
|
||||||
Write-Host "Starting service $serviceName"
|
Write-Host "Starting service $serviceName"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue