Skip to content

Commit 3b4496c

Browse files
authored
Merge pull request #10 from Leefrost/publish-config
Added base release config
2 parents d4822df + b3021b3 commit 3b4496c

File tree

5 files changed

+125
-61
lines changed

5 files changed

+125
-61
lines changed

.github/workflows/package.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- '*'
9+
release:
10+
types:
11+
- published
12+
13+
defaults:
14+
run:
15+
shell: pwsh
16+
17+
env:
18+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
19+
DOTNET_NOLOGO: true
20+
NuGetDirectory: ${{ github.workspace}}/nuget
21+
22+
jobs:
23+
create_nuget:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup .NET
31+
uses: actions/setup-dotnet@v3
32+
33+
- run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
34+
35+
- uses: actions/upload-artifact@v3
36+
with:
37+
name: nuget
38+
if-no-files-found: error
39+
retention-days: 7
40+
path: ${{ env.NuGetDirectory }}/*.nupkg
41+
42+
validate_nuget:
43+
runs-on: ubuntu-latest
44+
needs: [ create_nuget ]
45+
steps:
46+
- name: Setup .NET
47+
uses: actions/setup-dotnet@v3
48+
49+
- uses: actions/download-artifact@v3
50+
with:
51+
name: nuget
52+
path: ${{ env.NuGetDirectory }}
53+
54+
- name: Install nuget validator
55+
run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global
56+
57+
- name: Validate package
58+
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")
59+
60+
run_test:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v3
64+
65+
- name: Setup .NET
66+
uses: actions/setup-dotnet@v3
67+
68+
- name: Run tests
69+
run: dotnet test --configuration Release
70+
71+
deploy:
72+
if: github.event_name == 'release'
73+
runs-on: ubuntu-latest
74+
needs: [ validate_nuget, run_test ]
75+
steps:
76+
- uses: actions/download-artifact@v3
77+
with:
78+
name: nuget
79+
path: ${{ env.NuGetDirectory }}
80+
81+
- name: Setup .NET Core
82+
uses: actions/setup-dotnet@v3
83+
84+
- name: Publish NuGet package
85+
run: |
86+
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
87+
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
88+
}

HttpClient.Cache.nuspec

Lines changed: 0 additions & 38 deletions
This file was deleted.

icon.png

7.87 KB
Loading

src/HttpClient.Cache/HttpClient.Cache.csproj

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,44 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

9+
<PropertyGroup>
10+
<Authors>Sergii Lischuk</Authors>
11+
<Description>A simple and easy cache for HttpClient</Description>
12+
<PackageProjectUrl>https://codestory.me</PackageProjectUrl>
13+
<PackageTags>cache, httpclient, library</PackageTags>
14+
15+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
16+
<NoWarn>$(NoWarn);CS1591</NoWarn>
17+
<EnablePackageValidation>true</EnablePackageValidation>
18+
<!-- Optional: Detect breaking changes from a previous version -->
19+
<!-- <PackageValidationBaselineVersion>1.0.0</PackageValidationBaselineVersion> -->
20+
</PropertyGroup>
21+
22+
<PropertyGroup>
23+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
24+
</PropertyGroup>
25+
26+
<PropertyGroup>
27+
<PackageReadmeFile>README.md</PackageReadmeFile>
28+
</PropertyGroup>
29+
30+
<PropertyGroup>
31+
<PackageIcon>icon.png</PackageIcon>
32+
</PropertyGroup>
33+
34+
<ItemGroup>
35+
<None Include="icon.png" Pack="true" PackagePath="" />
36+
</ItemGroup>
37+
38+
<ItemGroup>
39+
<None Include="README.md" Pack="true" PackagePath="" />
40+
</ItemGroup>
41+
942
<ItemGroup>
43+
<PackageReference Include="MinVer" Version="4.3.0">
44+
<PrivateAssets>all</PrivateAssets>
45+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
46+
</PackageReference>
1047
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1148
</ItemGroup>
1249

0 commit comments

Comments
 (0)