From ae0c74cff892ee1b7feb06ae8fb5a15b94c81046 Mon Sep 17 00:00:00 2001 From: Charlie Poole Date: Sat, 25 Jul 2026 07:19:32 -0700 Subject: [PATCH 1/2] Update CI Workflow --- .../workflows/NUnitConsoleAndEngine.CI.yml | 57 ++++++++----------- build.cake | 2 +- test.ps1 | 3 + 3 files changed, 27 insertions(+), 35 deletions(-) create mode 100644 test.ps1 diff --git a/.github/workflows/NUnitConsoleAndEngine.CI.yml b/.github/workflows/NUnitConsoleAndEngine.CI.yml index b1a385832..02de048c2 100644 --- a/.github/workflows/NUnitConsoleAndEngine.CI.yml +++ b/.github/workflows/NUnitConsoleAndEngine.CI.yml @@ -2,13 +2,10 @@ on: workflow_dispatch: - pull_request: push: - branches-ignore: - - "azure-*" - paths-ignore: - - "*.txt" - - "*.md" + branches: + - main + pull_request: release: env: @@ -18,7 +15,7 @@ env: jobs: ContinuousIntegration: name: Continuous Integration - runs-on: windows-2025-vs2026 + runs-on: windows-latest env: MYGET_API_KEY: ${{ secrets.PUBLISH_MYGET_ORG }} @@ -28,12 +25,12 @@ jobs: steps: - name: โคต๏ธ Checkout Source - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: fetch-depth: 0 - name: ๐Ÿ› ๏ธ Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v6 with: dotnet-version: | 3.1.x @@ -45,30 +42,22 @@ jobs: - name: ๐Ÿ”ง Install dotnet tools run: dotnet tool restore - - name: ๐Ÿฐ Run cake - env: - MYGET_API_KEY: ${{ secrets.PUBLISH_MYGET_ORG }} - NUGET_API_KEY: ${{ secrets.PUBLISH_NUGET_ORG }} - CHOCO_API_KEY: ${{ secrets.PUBLISH_CHOCOLATEY_ORG }} - GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_CP }} - - # If you need to get more verbose logging, add the following to the dotnet-cake above: --verbosity=diagnostic - run: dotnet cake --target=ContinuousIntegration --configuration=Release - - - name: ๐Ÿชต Upload build logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: NUnitConsoleLogs - # This path is defined in build-settings.cake - path: "build-results/*.binlog" - # if-no-files-found: error + - name: ๐Ÿ”จ Build, Test and Package + run: dotnet cake --target=BuildTestAndPackage --configuration=Release #--verbosity=diagnostic - - name: ๐Ÿชต Upload NUnit Package Test Results - if: always() - uses: actions/upload-artifact@v4 + # Upload packages before publishing in case of later failures + - name: ๐Ÿ’พ Upload build artifacts + uses: actions/upload-artifact@v7 with: - name: NUnit Results - # This path is defined in build-settings.cake - path: "package/results/" - # if-no-files-found: error + name: NUnitConsole Packages + path: | + packages/*.nupkg + packages/results/ + + # TODO: Cake recipe skips build but repeats packaging before deciding + # not to publish. We should try to eliminate this, preferably in the + # recipe otherwise in this workflow. + - name: Publish (Cake script decides whether and where to publish) + run: | + dotnet minver + dotnet cake --target=Publish --configuration=Release --exclusive diff --git a/build.cake b/build.cake index 834388aac..fc4440e18 100644 --- a/build.cake +++ b/build.cake @@ -1,5 +1,5 @@ // Load the recipe -#load nuget:?package=NUnit.Cake.Recipe&version=2.0.0-beta.3.5 +#load nuget:?package=NUnit.Cake.Recipe&version=2.0.0-beta.4.2 // Comment out above line and uncomment below for local tests of recipe changes //#load ../NUnit.Cake.Recipe/src/NUnit.Cake.Recipe/content/*.cake diff --git a/test.ps1 b/test.ps1 new file mode 100644 index 000000000..18e9810b5 --- /dev/null +++ b/test.ps1 @@ -0,0 +1,3 @@ +$version_info = $(dotnet minver) +echo Publishing as + From d7dcd78ce96db86a05a52ce1b98f3ec6c19bf2f6 Mon Sep 17 00:00:00 2001 From: Charlie Poole Date: Sun, 26 Jul 2026 10:35:27 -0700 Subject: [PATCH 2/2] Simplify steps --- .github/workflows/NUnitConsoleAndEngine.CI.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/NUnitConsoleAndEngine.CI.yml b/.github/workflows/NUnitConsoleAndEngine.CI.yml index 02de048c2..5d3d582d2 100644 --- a/.github/workflows/NUnitConsoleAndEngine.CI.yml +++ b/.github/workflows/NUnitConsoleAndEngine.CI.yml @@ -42,22 +42,15 @@ jobs: - name: ๐Ÿ”ง Install dotnet tools run: dotnet tool restore - - name: ๐Ÿ”จ Build, Test and Package - run: dotnet cake --target=BuildTestAndPackage --configuration=Release #--verbosity=diagnostic + - name: ๐Ÿ”จ Build, Test, Package and Publish (Cake script decides) + run: dotnet cake --target=ContinuousIntegration --configuration=Release #--verbosity=diagnostic # Upload packages before publishing in case of later failures - name: ๐Ÿ’พ Upload build artifacts + if: always() uses: actions/upload-artifact@v7 with: name: NUnitConsole Packages path: | packages/*.nupkg packages/results/ - - # TODO: Cake recipe skips build but repeats packaging before deciding - # not to publish. We should try to eliminate this, preferably in the - # recipe otherwise in this workflow. - - name: Publish (Cake script decides whether and where to publish) - run: | - dotnet minver - dotnet cake --target=Publish --configuration=Release --exclusive