From b50e48205ecbc23709fb85c7de102cf118de691f Mon Sep 17 00:00:00 2001 From: Ant Browser Release Bot Date: Fri, 13 Mar 2026 23:38:49 +0800 Subject: [PATCH] publish: 1.0.0 snapshot (d5f0492) channel: master version: 1.0.0 source-ref: master published-at-utc: 2026-03-13T15:38:49Z --- tools/public-release/publish-public.bat | 8 +++++--- tools/public-release/publish-public.ps1 | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/public-release/publish-public.bat b/tools/public-release/publish-public.bat index 1f5041b5..9c8a2bf1 100644 --- a/tools/public-release/publish-public.bat +++ b/tools/public-release/publish-public.bat @@ -5,10 +5,12 @@ 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. +if "%EXIT_CODE%"=="0" ( + echo Publish finished successfully. +) else ( echo Publish failed with exit code %EXIT_CODE%. - pause ) +pause endlocal & exit /b %EXIT_CODE% diff --git a/tools/public-release/publish-public.ps1 b/tools/public-release/publish-public.ps1 index c4e4a7b6..9b43ecb7 100644 --- a/tools/public-release/publish-public.ps1 +++ b/tools/public-release/publish-public.ps1 @@ -529,12 +529,13 @@ function Publish-BranchRef { [Parameter(Mandatory = $true)] [string]$Commitish, [string]$RemoteExpectedOid, + [switch]$AllowRewrite, [switch]$DryRun ) $refSpec = "${Commitish}:refs/heads/$BranchName" $leaseArg = "" - if ((Get-TrimmedText $RemoteExpectedOid) -ne "") { + if ($AllowRewrite -and ((Get-TrimmedText $RemoteExpectedOid) -ne "")) { $leaseArg = "--force-with-lease=refs/heads/${BranchName}:${RemoteExpectedOid}" } @@ -749,7 +750,7 @@ try { if ($shouldPublishRelease) { Write-Step "Publishing release branch ref $releaseBranch" - Publish-BranchRef -RemoteName "public" -BranchName $releaseBranch -Commitish $publishedCommit -RemoteExpectedOid $releaseRemoteOid -DryRun:$publishDryRun + Publish-BranchRef -RemoteName "public" -BranchName $releaseBranch -Commitish $publishedCommit -RemoteExpectedOid $releaseRemoteOid -AllowRewrite -DryRun:$publishDryRun } if ($shouldPublishTag) {