Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Added GitHub CI and automatic release to NuGet #115

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root = true
35 changes: 35 additions & 0 deletions .github/workflows/Master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Master

on:
push:
branches:
- master
pull_request:

jobs:
build-test:
name: Build and Test
runs-on: ${{ matrix.os }}-latest

strategy:
matrix:
os: [windows, ubuntu, macos]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'

- name: Deps
run: dotnet restore Open.Nat.UnitTests/Open.Nat.Tests.csproj

- name: Build
run: dotnet build Open.Nat.UnitTests/Open.Nat.Tests.csproj --configuration Release --no-restore

- name: Test
# skip IPv6 tests: https://github.com/actions/runner-images/issues/668
run: dotnet test Open.Nat.UnitTests/Open.Nat.Tests.csproj --no-restore --verbosity normal --filter TestCategory!=IPv6
38 changes: 38 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Master

on:
push:
tags:
- '*'

jobs:
release:
name: Release
runs-on: ${{ matrix.os }}-latest

strategy:
matrix:
os: [windows]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'

- name: Deps
run: dotnet restore Open.Nat.UnitTests/Open.Nat.Tests.csproj

- name: Test
# skip IPv6 tests: https://github.com/actions/runner-images/issues/668
run: dotnet test Open.Nat.UnitTests/Open.Nat.Tests.csproj --no-restore --verbosity normal --filter TestCategory!=IPv6

- name: Pack
# skip signing until key added to GitHub secrets
run: dotnet pack /p:SignAssembly=false /p:Version=${{ github.ref_name }} Open.Nat/Open.Nat.csproj --no-restore

- name: Publish
run: dotnet nuget push **.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
6 changes: 0 additions & 6 deletions .nuget/NuGet.Config

This file was deleted.

Binary file removed .nuget/NuGet.exe
Binary file not shown.
144 changes: 0 additions & 144 deletions .nuget/NuGet.targets

This file was deleted.

1 change: 1 addition & 0 deletions Open.Nat.UnitTests/InternetProtocolV6Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Open.Nat.Tests
{
[TestClass]
[TestCategory("IPv6")]
public class InternetProtocolV6Tests
{
private UpnpMockServer _server;
Expand Down
32 changes: 32 additions & 0 deletions Open.Nat.UnitTests/Open.Nat.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Open.Nat.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>

<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Open.Nat\Open.Nat.csproj" />
</ItemGroup>

</Project>
Loading