Skip to content

Use GitHub action and modernize packaging #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit 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
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Use GitVersion
run: |
dotnet tool install --global GitVersion.Tool --version 5.3.7
dotnet-gitversion /output buildserver /nofetch
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-restore --verbosity normal
- name: Upload artifact
uses: actions/[email protected]
with:
path: |
AutofacContrib.NSubstitute/bin/Release/*.nupkg
AutofacContrib.NSubstitute/bin/Release/*.snupkg
2 changes: 2 additions & 0 deletions AutofacContrib.NSubstitute.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A5ECD18F-1D42-444E-BB3A-6062D8B0E256}"
ProjectSection(SolutionItems) = preProject
BREAKING_CHANGES.md = BREAKING_CHANGES.md
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
GitVersionConfig.yaml = GitVersionConfig.yaml
global.json = global.json
LICENSE = LICENSE
Expand Down
17 changes: 14 additions & 3 deletions AutofacContrib.NSubstitute/AutofacContrib.NSubstitute.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>AutofacContrib.NSubstitute</AssemblyName>
<RootNamespace>AutofacContrib.NSubstitute</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.9.4</Version>
<AssemblyVersion>4.9.4.0</AssemblyVersion>
</PropertyGroup>

<PropertyGroup>
<Authors>Miguel Madero, Robert Moore and Matt Davies</Authors>
<Description>Auto-mocking Autofac container that uses NSubstitute.</Description>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageIcon>logo.png</PackageIcon>
<PackageTags>substitute mocking mocks nsubstitute autofac container dependency-injection di testing unit-testing TDD AAA auto-mock auto-substitute</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="5.2.0" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
</ItemGroup>

<ItemGroup>
<None Include="../LICENSE" Pack="true" PackagePath=""/>
<None Include="../logo.png" Pack="true" PackagePath=""/>
</ItemGroup>

</Project>
43 changes: 0 additions & 43 deletions AutofacContrib.NSubstitute/AutofacContrib.NSubstitute.nuspec

This file was deleted.

25 changes: 25 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project>

<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<PropertyGroup>
<InformationalVersion>$(GitVersion_InformationalVersion)</InformationalVersion>
<FileVersion>$(GitVersion_MajorMinorPatch)</FileVersion>
<AssemblyVersion>$(GitVersion_AssemblySemVer)</AssemblyVersion>
<Version>$(GitVersion_NuGetVersionV2)</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
AutofacContrib.NSubstitute (AutoSubstitute)
===========================================

[![Build status](https://ci.appveyor.com/api/projects/status/wwmq5opfp47ff937?svg=true)](https://ci.appveyor.com/project/MRCollective/autofaccontrib-nsubstitute)
[![Build](https://github.com/MRCollective/AutofacContrib.NSubstitute/workflows/Build/badge.svg)](https://github.com/MRCollective/AutofacContrib.NSubstitute/actions?query=workflow%3ABuild)
[![NuGet downloads](https://img.shields.io/nuget/dt/AutofacContrib.NSubstitute.svg)](https://www.nuget.org/packages/AutofacContrib.NSubstitute)
[![NuGet version](https://img.shields.io/nuget/vpre/AutofacContrib.NSubstitute.svg)](https://www.nuget.org/packages/AutofacContrib.NSubstitute)

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.1.302",
"version": "3.1.402",
"rollForward": "feature"
}
}