Skip to content

Commit

Permalink
Build and test on both 3.1 and 5.0, and use multi-targeting
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeuwen committed Jun 6, 2021
1 parent 89a3726 commit 2945004
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
dotnet: [3.1.x, 5.0.x]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: ${{ matrix.dotnet }}
- name: Install dependencies
run: dotnet restore
- name: Build
Expand All @@ -32,9 +37,16 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./TestResults/coverage.info

publish:
runs-on: ubuntu-latest

needs: [build]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

steps:
- name: Publish NuGet
id: publish_nuget
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: brandedoutcast/publish-nuget@v2.5.5
with:
PROJECT_FILE_PATH: AspNetCore.ReCaptcha/AspNetCore.ReCaptcha.csproj
Expand Down
9 changes: 8 additions & 1 deletion AspNetCore.ReCaptcha/AspNetCore.ReCaptcha.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<PackageId>AspNetCore.ReCaptcha</PackageId>
<Version>1.2.2</Version>
<Authors>Michaelvs97,sleeuwen</Authors>
Expand All @@ -15,7 +15,14 @@

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
</ItemGroup>

</Project>

0 comments on commit 2945004

Please sign in to comment.