Skip to content

Commit

Permalink
Package library versions for netstandard2.0 and netcoreapp3.1. (#31)
Browse files Browse the repository at this point in the history
* chore: Add build matrix to include netcoreapp 2.1 and 3.1

* chore: Update target frameworks in csproj files

* chore: Change 3.1 version to 3.1.104

* chore: Fix dotnet framework matrix parameter

* chore: Update csproj to support PDB

[+] Add snupkg symbols support
[+] Add PDB to NuGet package
[-] Remove redundant conditional Version tag

* chore: Fix NuGet warnings and refactor csproj

* chore: Bump version [skip ci]

* docs: Add readme to NuGet package [skip ci]

* chore: Remove [skip ci] support because of possible problems on PR

* docs: Add NuGet badge to README
  • Loading branch information
Ceridan authored May 19, 2020
1 parent 1b7ff9b commit dcba698
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 37 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@ on:
- "!master"

jobs:
build-and-test:
name: Build and test library
run-tests:
runs-on: ubuntu-latest

if: ${{ !contains(github.event.commits[0].message, '[skip ci]') }}
strategy:
matrix:
dotnet: [
{ framework: netcoreapp2.1, version: 2.1.806 },
{ framework: netcoreapp3.1, version: 3.1.202 }
]

name: ${{ matrix.dotnet.framework }} – run tests

steps:
- uses: actions/checkout@master

- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.100"
dotnet-version: ${{ matrix.dotnet.version }}

- name: Build and tests library
- name: Run tests
run: |
dotnet build --configuration Release ./src/Dodo.HttpClient.ResiliencePolicies/Dodo.HttpClient.ResiliencePolicies.csproj
dotnet test --configuration Release ./src/Dodo.HttpClient.ResiliencePolicies.Tests/Dodo.HttpClient.ResiliencePolicies.Tests.csproj
dotnet test --configuration Release --framework ${{ matrix.dotnet.framework }} ./src/Dodo.HttpClient.ResiliencePolicies.Tests/Dodo.HttpClient.ResiliencePolicies.Tests.csproj /p:Framework=${{ matrix.dotnet.framework }}
21 changes: 13 additions & 8 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,36 @@ on:
- master

jobs:
build-and-test:
name: Build and test library
run-tests:
runs-on: ubuntu-latest

if: ${{ !contains(github.event.commits[0].message, '[skip ci]') }}
strategy:
matrix:
dotnet: [
{ framework: netcoreapp2.1, version: 2.1.806 },
{ framework: netcoreapp3.1, version: 3.1.202 }
]

name: ${{ matrix.dotnet.framework }} – run tests

steps:
- uses: actions/checkout@master

- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.100"
dotnet-version: ${{ matrix.dotnet.version }}

- name: Build and test library
- name: Run tests
run: |
dotnet build --configuration Release ./src/Dodo.HttpClient.ResiliencePolicies/Dodo.HttpClient.ResiliencePolicies.csproj
dotnet test --configuration Release ./src/Dodo.HttpClient.ResiliencePolicies.Tests/Dodo.HttpClient.ResiliencePolicies.Tests.csproj
dotnet test --configuration Release --framework ${{ matrix.dotnet.framework }} ./src/Dodo.HttpClient.ResiliencePolicies.Tests/Dodo.HttpClient.ResiliencePolicies.Tests.csproj /p:Framework=${{ matrix.dotnet.framework }}
release:
name: Create release
runs-on: ubuntu-latest

needs: build-and-test
needs: run-tests

steps:
- uses: actions/checkout@v1
Expand Down
46 changes: 42 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,37 @@ on:
types: [published]

jobs:
run-tests:
runs-on: ubuntu-latest

strategy:
matrix:
dotnet: [
{ framework: netcoreapp2.1, version: 2.1.806 },
{ framework: netcoreapp3.1, version: 3.1.202 }
]

name: ${{ matrix.dotnet.framework }} – run tests

steps:
- uses: actions/checkout@master

- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet.version }}

- name: Run tests
run: |
dotnet test --configuration Release --framework ${{ matrix.dotnet.framework }} ./src/Dodo.HttpClient.ResiliencePolicies.Tests/Dodo.HttpClient.ResiliencePolicies.Tests.csproj /p:Framework=${{ matrix.dotnet.framework }}
build-and-publish:
name: Build and publish library to NuGet
runs-on: ubuntu-latest

needs: run-tests

steps:
- uses: actions/checkout@master

Expand All @@ -35,14 +62,14 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.100"
dotnet-version: 3.1.202

- name: Build and publish library to NuGet
run: |
dotnet build --configuration Release ./src/Dodo.HttpClient.ResiliencePolicies/Dodo.HttpClient.ResiliencePolicies.csproj
dotnet test --configuration Release ./src/Dodo.HttpClient.ResiliencePolicies.Tests/Dodo.HttpClient.ResiliencePolicies.Tests.csproj
dotnet pack --no-restore --no-build --configuration Release --version-suffix "${{ steps.extract-version-suffix.outputs.version_suffix }}" --output out/ ./src/Dodo.HttpClient.ResiliencePolicies/Dodo.HttpClient.ResiliencePolicies.csproj
dotnet nuget push out/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
- uses: actions/upload-artifact@master
with:
name: NuGet package
Expand All @@ -64,9 +91,10 @@ jobs:
- name: Get package
id: get-package
run: |
echo "::set-output name=package::$(ls out/)"
echo "::set-output name=package::$(ls out/*.nupkg)"
echo "::set-output name=symbols::$(ls out/*.snupkg)"
- name: Upload release assets
- name: Upload package asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -75,3 +103,13 @@ jobs:
asset_path: ./out/${{ steps.get-package.outputs.package }}
asset_name: ${{ steps.get-package.outputs.package }}
asset_content_type: application/zip

- name: Upload symbols asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./out/${{ steps.get-package.outputs.symbols }}
asset_name: ${{ steps.get-package.outputs.symbols }}
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dodo.HttpClient.ResiliencePolicies library

[![nuget](https://img.shields.io/nuget/v/Dodo.HttpClient.ResiliencePolicies?label=NuGet)](https://www.nuget.org/packages/Dodo.HttpClient.ResiliencePolicies)
![master](https://github.com/dodopizza/httpclient-resilience-policies/workflows/master/badge.svg)
![release](https://github.com/dodopizza/httpclient-resilience-policies/workflows/release/badge.svg)

The main goal of this library is to provide unified http request retrying policies for the HttpClient that just works.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks Condition="'$(Framework)' != 'netcoreapp2.1'">netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFramework Condition="'$(Framework)' == 'netcoreapp2.1'">netcoreapp2.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<VersionPrefix>1.0.1</VersionPrefix>
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix)</Version>
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>

<PackageId>Dodo.HttpClient.ResiliencePolicies</PackageId>
<Authors>Dodo Pizza</Authors>
<Company>Dodo Pizza</Company>
<Description>The main goal of this library is to provide unified http request retrying policies for the HttpClient that just works. Actually this library wraps awesome Polly library with the predefined settings to allow developers to use it as is without a deep dive to Polly.</Description>
<RepositoryUrl>https://github.com/dodopizza/httpclient-resilience-policies</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>Copyright 2020 Dodo Pizza</Copyright>
<PackageLicenseUrl>https://raw.githubusercontent.com/dodopizza/httpclient-resilience-policies/master/LICENSE</PackageLicenseUrl>
<TargetFrameworks Condition="'$(Framework)' != 'netcoreapp2.1'">netstandard2.0;netcoreapp3.1</TargetFrameworks>
<TargetFramework Condition="'$(Framework)' == 'netcoreapp2.1'">netstandard2.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<VersionPrefix>1.0.2</VersionPrefix>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
Expand All @@ -21,10 +12,40 @@
<PackageReference Include="Polly" Version="7.2.0" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.0" />
</ItemGroup>
<PropertyGroup Label="NuspecProperties">
<NeutralLanguage>en-US</NeutralLanguage>
<ItemGroup>
<None Include="..\..\dodopizza-logo.png">
<PackagePath>\</PackagePath>
<Pack>true</Pack>
<Link>dodopizza-logo.png</Link>
</None>
<None Include="..\..\LICENSE">
<PackagePath>\</PackagePath>
<Pack>true</Pack>
<Link>LICENSE</Link>
</None>
<None Include="..\..\README.md">
<PackagePath>\</PackagePath>
<Pack>true</Pack>
<Link>README.md</Link>
</None>
</ItemGroup>
<PropertyGroup Label="nuspec">
<PackageId>Dodo.HttpClient.ResiliencePolicies</PackageId>
<AssemblyTitle>Dodo.HttpClient.ResiliencePolicies</AssemblyTitle>
<PackageIconUrl>https://raw.github.com/dodopizza/httpclient-resilience-policies/master/dodopizza-logo.png</PackageIconUrl>
<Authors>Dodo Pizza</Authors>
<Company>Dodo Pizza</Company>
<Description>The main goal of this library is to provide unified http request retrying policies for the HttpClient that just works. Actually this library wraps awesome Polly library with the predefined settings to allow developers to use it as is without a deep dive to Polly.</Description>
<RepositoryUrl>https://github.com/dodopizza/httpclient-resilience-policies</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>Copyright 2020 Dodo Pizza</Copyright>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageIcon>dodopizza-logo.png</PackageIcon>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>HttpClient Resilience Policy CircuitBreaker Retry Timeout</PackageTags>
<NeutralLanguage>en-US</NeutralLanguage>
</PropertyGroup>
</Project>

0 comments on commit dcba698

Please sign in to comment.