From 79929f24ea3850df090513ae894863c090318613 Mon Sep 17 00:00:00 2001 From: Ant Browser Release Bot Date: Fri, 13 Mar 2026 23:30:24 +0800 Subject: [PATCH] publish: 1.0.0 snapshot (d0230b6) channel: master version: 1.0.0 source-ref: master published-at-utc: 2026-03-13T15:30:24Z --- tools/public-release/README.md | 2 +- tools/public-release/publish-public.bat | 6 ++++++ tools/public-release/publish-public.ps1 | 20 ++++++++++++-------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/tools/public-release/README.md b/tools/public-release/README.md index da781c0f..8549f776 100644 --- a/tools/public-release/README.md +++ b/tools/public-release/README.md @@ -16,7 +16,7 @@ tools\public-release\publish-public.bat Behavior: -- public `master` is always published as one aggregated commit +- public `master` keeps history and appends one aggregated commit per publish - the script shows console options for publish scope: `master` / `master+release` / `master+tag` / `master+release+tag` - running the script will publish directly; use `-DryRun` only when you explicitly want a no-push preview - command line switches are kept only for automation/manual override diff --git a/tools/public-release/publish-public.bat b/tools/public-release/publish-public.bat index 4be67e98..1f5041b5 100644 --- a/tools/public-release/publish-public.bat +++ b/tools/public-release/publish-public.bat @@ -5,4 +5,10 @@ set "SCRIPT_DIR=%~dp0" powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%publish-public.ps1" -AllowDirtyWorkingTree %* set "EXIT_CODE=%ERRORLEVEL%" +if not "%EXIT_CODE%"=="0" ( + echo. + echo Publish failed with exit code %EXIT_CODE%. + pause +) + endlocal & exit /b %EXIT_CODE% diff --git a/tools/public-release/publish-public.ps1 b/tools/public-release/publish-public.ps1 index 85778753..c4e4a7b6 100644 --- a/tools/public-release/publish-public.ps1 +++ b/tools/public-release/publish-public.ps1 @@ -721,8 +721,16 @@ try { Invoke-Git -Args @("config", "user.name", $committer.Name) | Out-Null Invoke-Git -Args @("config", "user.email", $committer.Email) | Out-Null - Write-Step "Publishing snapshot to $TargetBranch (single-commit branch)" - Invoke-Git -Args @("checkout", "--orphan", $TargetBranch) | Out-Null + if ((Get-TrimmedText $targetRemoteOid) -ne "") { + Write-Step "Loading current public $TargetBranch" + Invoke-Git -Args @("fetch", "--no-tags", "public", "refs/heads/${TargetBranch}:refs/remotes/public/$TargetBranch") | Out-Null + Invoke-Git -Args @("checkout", "-B", $TargetBranch, "refs/remotes/public/$TargetBranch") | Out-Null + } else { + Write-Step "Creating initial public $TargetBranch" + Invoke-Git -Args @("checkout", "--orphan", $TargetBranch) | Out-Null + } + + Write-Step "Publishing snapshot to $TargetBranch (one aggregated commit)" Sync-SnapshotToRepo -SnapshotDir $snapshotDir -RepoDir $workRepoDir Invoke-Git -Args @("add", "-A") | Out-Null @@ -733,13 +741,9 @@ try { -SourceRefValue $SourceRef ` -SourceCommit $sourceCommit ` -AppendSourceCommit:$IncludeSourceCommit - Invoke-GitCommit -Message $targetMessage + Invoke-GitCommit -Message $targetMessage -AllowEmpty $publishedCommit = Get-FirstOutputLine -Lines (Invoke-Git -Args @("rev-parse", "HEAD")).Output - $targetCount = Get-FirstOutputLine -Lines (Invoke-Git -Args @("rev-list", "--count", $TargetBranch)).Output - if ($targetCount -ne "1") { - throw "Local target branch $TargetBranch is expected to have exactly 1 commit, got $targetCount." - } Publish-BranchRef -RemoteName "public" -BranchName $TargetBranch -Commitish $publishedCommit -RemoteExpectedOid $targetRemoteOid -DryRun:$publishDryRun @@ -768,7 +772,7 @@ try { Write-Step "Publish completed" Write-Host "Published source commit: $sourceCommit" - Write-Host "Updated target branch: $TargetBranch (always single commit)" + Write-Host "Updated target branch: $TargetBranch (appends one aggregated commit per publish)" if ($shouldPublishRelease) { Write-Host "Updated release branch: $releaseBranch" }