Skip to content

Commit

Permalink
Added publish build to myget
Browse files Browse the repository at this point in the history
  • Loading branch information
OsirisTerje committed Apr 10, 2024
1 parent f9b355a commit fd7a0f9
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 12 deletions.
@@ -1,4 +1,5 @@
name: NUnit3TestAdapter.Cake.CI

name: NUnit3TestAdapter.CI

on: [push, pull_request,workflow_dispatch]

Expand Down
59 changes: 59 additions & 0 deletions .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
}
1 change: 1 addition & 0 deletions NUnit3TestAdapter.sln
Expand Up @@ -53,6 +53,7 @@ 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
NUnit3TestAdapter.Myget.Publish.yml = NUnit3TestAdapter.Myget.Publish.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcoreapp3.1", "netcoreapp3.1", "{2F940513-5B8F-45A5-A188-7C5D03D1B50D}"
Expand Down
13 changes: 2 additions & 11 deletions src/NUnitTestAdapterTests/Fakes/FakeDiscoveryContext.cs
Expand Up @@ -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;
}

0 comments on commit fd7a0f9

Please sign in to comment.