From 10fef5c6a79459ba39c43447b7a29b4d091ec9e3 Mon Sep 17 00:00:00 2001 From: smaillet Date: Sun, 13 Jul 2025 10:27:27 -0700 Subject: [PATCH] Unified Build Infrastructure across Family of projects --- .github/workflows/release-build.yml | 17 +++++++---------- OneFlow/Publish-Release.ps1 | 8 ++++---- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 1381cd9..1a44c15 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -67,16 +67,13 @@ jobs: directory: .\BuildOutput\docs branch: gh-pages -# no automatic publication of NuGet packages, too much room for mistakes as publication to NuGet -# cannot be undone. The packages must be manually published AFTER a successful GH release process -# as a GH release ca be undone! -# - name: Publish packages to NuGet.org -# run: | -# if( [string]::IsNullOrWhiteSpace('${{secrets.NUGETPUSH_ACCESS_TOKEN}}')) -# { -# throw "'NUGETPUSH_ACCESS_TOKEN' does not exist, is empty or all whitespace!" -# } -# dotnet nuget push .\BuildOutput\NuGet\*.nupkg --api-key '${{secrets.NUGETPUSH_ACCESS_TOKEN}}' --source 'https://api.nuget.org/v3/index.json' --skip-duplicate + - name: Publish packages to NuGet.org + run: | + if( [string]::IsNullOrWhiteSpace('${{secrets.NUGETPUSH_ACCESS_TOKEN}}')) + { + throw "'NUGETPUSH_ACCESS_TOKEN' does not exist, is empty or all whitespace!" + } + dotnet nuget push .\BuildOutput\NuGet\*.nupkg --api-key '${{secrets.NUGETPUSH_ACCESS_TOKEN}}' --source 'https://api.nuget.org/v3/index.json' --skip-duplicate - name: Create Release if: (!cancelled()) diff --git a/OneFlow/Publish-Release.ps1 b/OneFlow/Publish-Release.ps1 index a1da0a3..193a9a4 100644 --- a/OneFlow/Publish-Release.ps1 +++ b/OneFlow/Publish-Release.ps1 @@ -74,10 +74,10 @@ if($PSCmdlet.ShouldProcess("$forkRemoteName $mergeBackBranchName", "git push")) Invoke-External git push $forkRemoteName $mergeBackBranchName } -if($PSCmdlet.ShouldProcess("$tagName", "Fast-Forward main (Switch, merge -ff-only, push)")) +if($PSCmdlet.ShouldProcess("$tagName", "Reset main to point to release tag")) { - Write-Information 'Fast-forwarding main to tagged release' + Write-Information 'Updating main to point to tagged release' Invoke-External git switch '-C' $mainBranchName $officialMainBranch - Invoke-External git merge --ff-only $tagName - Invoke-External git push $officialRemoteName $mainBranchName + Invoke-External git reset --hard $tagName + Invoke-External git push --force $officialRemoteName $mainBranchName }