From 2b040751f9043f35242fb9e15c40f2f6da1531d4 Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Thu, 11 Apr 2024 11:42:19 +0200 Subject: [PATCH] Publishbuild (#1165) * Added publish build to myget * Added myget publish and fixed build badge and copyright years --- ...r.Cake.CI.yml => NUnit3TestAdapter.CI.yml} | 3 +- .../NUnit3TestAdapter.Myget.Publish.yml | 59 +++++++++++++++++++ LICENSE | 2 +- NUnit3TestAdapter.sln | 3 +- README.md | 3 +- nuget/NUnit3TestAdapter.nuspec | 2 +- .../Fakes/FakeDiscoveryContext.cs | 13 +--- 7 files changed, 68 insertions(+), 17 deletions(-) rename .github/workflows/{NUnit3TestAdapter.Cake.CI.yml => NUnit3TestAdapter.CI.yml} (91%) create mode 100644 .github/workflows/NUnit3TestAdapter.Myget.Publish.yml diff --git a/.github/workflows/NUnit3TestAdapter.Cake.CI.yml b/.github/workflows/NUnit3TestAdapter.CI.yml similarity index 91% rename from .github/workflows/NUnit3TestAdapter.Cake.CI.yml rename to .github/workflows/NUnit3TestAdapter.CI.yml index 1dd2fc8c..cfcdfdd7 100644 --- a/.github/workflows/NUnit3TestAdapter.Cake.CI.yml +++ b/.github/workflows/NUnit3TestAdapter.CI.yml @@ -1,4 +1,5 @@ -name: NUnit3TestAdapter.Cake.CI + +name: NUnit3TestAdapter.CI on: [push, pull_request,workflow_dispatch] diff --git a/.github/workflows/NUnit3TestAdapter.Myget.Publish.yml b/.github/workflows/NUnit3TestAdapter.Myget.Publish.yml new file mode 100644 index 00000000..c7d7c1d2 --- /dev/null +++ b/.github/workflows/NUnit3TestAdapter.Myget.Publish.yml @@ -0,0 +1,59 @@ +name: NUnit3TestAdapter.Myget.Publish + +on: + push: + branches: + - main + - master + - release + - 'v3' + - myget + workflow_dispatch: + +defaults: + run: + shell: pwsh +jobs: + build-windows: + name: Windows Build + runs-on: windows-latest + + steps: + - name: ⤵️ Checkout Source + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 🛠️ Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 3.1.x + 5.0.x + 6.0.x + 7.0.x + 8.0.x + + - name: 🛠️ Install dotnet tools + run: dotnet tool restore + + - name: 🔨 Build + run: dotnet tool run dotnet-cake --configuration=Release + + - name: 📦 Package + run: dotnet tool run dotnet-cake --target=Package + + - name: 💾 Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: Package + path: package + + - name: Publish nupkg and snupkg to Myget.org + run: | + foreach($file in (Get-ChildItem package -Recurse -Include *.nupkg)) { + dotnet nuget push $file --api-key "${{ secrets.PUBLISHMYGET }}" --source https://www.myget.org/F/nunit/api/v3/index.json --skip-duplicate + } + foreach($file in (Get-ChildItem "package" -Recurse -Include *.snupkg)) { + dotnet nuget push $file --api-key "${{ secrets.PUBLISHMYGET }}" --source https://www.myget.org/F/nunit/api/v3/index.json --skip-duplicate + } diff --git a/LICENSE b/LICENSE index 6783f2bb..00fc8dcf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2011-2020 Charlie Poole, 2014-2023 Terje Sandstrom +Copyright (c) 2011-2020 Charlie Poole, 2014-2024 Terje Sandstrom Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/NUnit3TestAdapter.sln b/NUnit3TestAdapter.sln index 0ad680df..3b2063de 100644 --- a/NUnit3TestAdapter.sln +++ b/NUnit3TestAdapter.sln @@ -52,7 +52,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{062B17 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{7D708804-B2F1-4A31-A9FB-85A0C7433200}" ProjectSection(SolutionItems) = preProject - .github\workflows\NUnit3TestAdapter.Cake.CI.yml = .github\workflows\NUnit3TestAdapter.Cake.CI.yml + .github\workflows\NUnit3TestAdapter.CI.yml = .github\workflows\NUnit3TestAdapter.CI.yml + .github\workflows\NUnit3TestAdapter.Myget.Publish.yml = .github\workflows\NUnit3TestAdapter.Myget.Publish.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcoreapp3.1", "netcoreapp3.1", "{2F940513-5B8F-45A5-A188-7C5D03D1B50D}" diff --git a/README.md b/README.md index c87eed34..a4eeb083 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,7 @@ or the latest developer build version ##### Builds on master -[![Cake build](https://img.shields.io/azure-devops/build/nunit/9d7ec8eb-1a1a-4fff-a88f-43bcdceb5f33/12.svg)](https://nunit.visualstudio.com/NUnit/_build?definitionId=12&_a=completed) -[![VS Build](https://img.shields.io/azure-devops/build/nunit/9d7ec8eb-1a1a-4fff-a88f-43bcdceb5f33/4.svg)](https://nunit.visualstudio.com/NUnit/_build?definitionId=4&_a=completed) +![NUnit3TestAdapter.CI](https://img.shields.io/github/actions/workflow/status/nunit/nunit3-vs-adapter/NUnit3TestAdapter.CI.yml?branch=master) [![Tests](https://img.shields.io/azure-devops/tests/nunit/nunit/4)](https://nunit.visualstudio.com/NUnit/_build?definitionId=4&_a=completed) [![Coverage](https://img.shields.io/azure-devops/coverage/nunit/nunit/4.svg)](https://nunit.visualstudio.com/NUnit/_build?definitionId=4&_a=completed) diff --git a/nuget/NUnit3TestAdapter.nuspec b/nuget/NUnit3TestAdapter.nuspec index 387fc517..277a6b20 100644 --- a/nuget/NUnit3TestAdapter.nuspec +++ b/nuget/NUnit3TestAdapter.nuspec @@ -19,7 +19,7 @@ For VS 2017 and forward, you should add this package to every test project in your solution. (Earlier versions only require a single adapter package per solution.) See https://docs.nunit.org/articles/vs-test-adapter/Adapter-Release-Notes.html - Copyright (c) 2011-2021 Charlie Poole, 2014-2023 Terje Sandstrom + Copyright (c) 2011-2021 Charlie Poole, 2014-2024 Terje Sandstrom en-US test visualstudio testadapter nunit nunit3 dotnet diff --git a/src/NUnitTestAdapterTests/Fakes/FakeDiscoveryContext.cs b/src/NUnitTestAdapterTests/Fakes/FakeDiscoveryContext.cs index 0cbf946e..5667535d 100644 --- a/src/NUnitTestAdapterTests/Fakes/FakeDiscoveryContext.cs +++ b/src/NUnitTestAdapterTests/Fakes/FakeDiscoveryContext.cs @@ -25,16 +25,7 @@ namespace NUnit.VisualStudio.TestAdapter.Tests.Fakes; -class FakeDiscoveryContext : IDiscoveryContext +class FakeDiscoveryContext(IRunSettings runSettings) : IDiscoveryContext { - public FakeDiscoveryContext(IRunSettings runSettings) - { - RunSettings = runSettings; - } - - #region IDiscoveryContextMembers - - public IRunSettings RunSettings { get; } - - #endregion + public IRunSettings RunSettings { get; } = runSettings; } \ No newline at end of file