updater fixed
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
param(
|
||||
[string]$Remote = "git@gitea.itworx.tech:Jens/ForgeFlow.git",
|
||||
[string]$Branch = "main",
|
||||
[string]$InstalledSource = "C:\Projects\ForgeFlow"
|
||||
[string]$InstalledSource = "C:\Projects\ForgeFlow",
|
||||
[string]$UserDataPath = "",
|
||||
[switch]$SkipBinaryRelease
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -58,6 +60,47 @@ try {
|
||||
|
||||
Write-Host "ForgeFlow $version is available on Gitea at commit $($publishedCommit.Substring(0,7))." -ForegroundColor Green
|
||||
|
||||
if (-not $SkipBinaryRelease) {
|
||||
Write-Host "Building and publishing the matching Windows installer and portable release..." -ForegroundColor Cyan
|
||||
Push-Location $clone
|
||||
try {
|
||||
& cmd.exe /d /s /c "npm ci --no-audit --no-fund"
|
||||
if ($LASTEXITCODE -ne 0) { throw "npm ci failed in the exact published checkout." }
|
||||
& cmd.exe /d /s /c "npm run check"
|
||||
if ($LASTEXITCODE -ne 0) { throw "The exact published checkout failed the release quality gate." }
|
||||
& cmd.exe /d /s /c "npm run dist:win"
|
||||
if ($LASTEXITCODE -ne 0) { throw "The Windows release build failed." }
|
||||
|
||||
$expectedAssets = @(
|
||||
"ForgeFlow-Setup-$version-win-x64.exe",
|
||||
"ForgeFlow-Setup-$version-win-x64.exe.sha256",
|
||||
"ForgeFlow-Portable-$version-win-x64.exe",
|
||||
"ForgeFlow-Portable-$version-win-x64.exe.sha256"
|
||||
)
|
||||
foreach ($assetName in $expectedAssets) {
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $clone "dist\$assetName"))) {
|
||||
throw "The Windows build did not produce $assetName."
|
||||
}
|
||||
}
|
||||
|
||||
$resolvedUserData = if ($UserDataPath) { $UserDataPath } else { Join-Path $env:APPDATA "forgeflow" }
|
||||
$previousUserData = $env:FORGEFLOW_USER_DATA
|
||||
$previousBranch = $env:FORGEFLOW_RELEASE_BRANCH
|
||||
try {
|
||||
$env:FORGEFLOW_USER_DATA = $resolvedUserData
|
||||
$env:FORGEFLOW_RELEASE_BRANCH = $Branch
|
||||
& cmd.exe /d /s /c "npm run release:binary"
|
||||
if ($LASTEXITCODE -ne 0) { throw "The Gitea binary release publisher failed." }
|
||||
} finally {
|
||||
$env:FORGEFLOW_USER_DATA = $previousUserData
|
||||
$env:FORGEFLOW_RELEASE_BRANCH = $previousBranch
|
||||
}
|
||||
} finally { Pop-Location }
|
||||
Write-Host "ForgeFlow $version source and Windows release assets are both published." -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Binary publication was skipped explicitly. Packaged ForgeFlow installations cannot auto-update until the release assets are published." -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
$installedManifestPath = Join-Path $InstalledSource "package.json"
|
||||
if (Test-Path -LiteralPath $installedManifestPath) {
|
||||
try {
|
||||
@@ -123,7 +166,11 @@ try {
|
||||
Write-Host "Installed source was not found at $InstalledSource; publication itself succeeded." -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host "Open the installed older ForgeFlow and use Settings -> ForgeFlow updates -> Check now." -ForegroundColor Cyan
|
||||
if ($SkipBinaryRelease) {
|
||||
Write-Host "Source publication completed. Run Publish-Missing-Binary-Release.ps1 before using the updater from an installed EXE." -ForegroundColor Yellow
|
||||
} else {
|
||||
Write-Host "Open the installed older ForgeFlow and use Settings -> ForgeFlow updates -> Check now." -ForegroundColor Cyan
|
||||
}
|
||||
}
|
||||
finally {
|
||||
Remove-Item -LiteralPath $temp -Recurse -Force -ErrorAction SilentlyContinue
|
||||
|
||||
Reference in New Issue
Block a user