Skip to content

Commit 99f1ffc

Browse files
Karl Solgårdclaude
andcommitted
Add NuGet packaging metadata and GitHub Actions workflows
CI builds and tests on push/PR to main. Publish workflow packs and pushes all packages to NuGet on release, taking the version from the release tag. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d9aa80b commit 99f1ffc

3 files changed

Lines changed: 84 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-dotnet@v4
16+
with:
17+
dotnet-version: 10.0.x
18+
19+
- name: Restore
20+
run: dotnet restore
21+
22+
- name: Build
23+
run: dotnet build --configuration Release --no-restore
24+
25+
- name: Test
26+
run: dotnet test --configuration Release --no-build --verbosity normal

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-dotnet@v4
16+
with:
17+
dotnet-version: 10.0.x
18+
19+
# Tag "v1.2.3" -> package version "1.2.3"
20+
- name: Resolve version from tag
21+
id: ver
22+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
23+
24+
- name: Test
25+
run: dotnet test --configuration Release
26+
27+
- name: Pack
28+
run: dotnet pack --configuration Release -o artifacts -p:Version=${{ steps.ver.outputs.version }}
29+
30+
- name: Push
31+
run: >
32+
dotnet nuget push "artifacts/*.nupkg"
33+
--api-key ${{ secrets.NUGET_API_KEY }}
34+
--source https://api.nuget.org/v3/index.json
35+
--skip-duplicate

Directory.Build.props

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,27 @@
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99
<NoWarn>$(NoWarn);CS1591</NoWarn>
1010
</PropertyGroup>
11+
12+
<!-- NuGet package metadata (applied to all packable libraries) -->
13+
<PropertyGroup Condition="'$(IsPackable)' != 'false'">
14+
<Version>1.0.0</Version>
15+
<Authors>CosX</Authors>
16+
<Company>CosX</Company>
17+
<Copyright>Copyright 2026 CosX. Original work Copyright 2018 Netflix, Inc.</Copyright>
18+
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
19+
<PackageReadmeFile>README.md</PackageReadmeFile>
20+
<PackageProjectUrl>https://github.com/CosX/ConcurrencyLimits.NET</PackageProjectUrl>
21+
<RepositoryUrl>https://github.com/CosX/ConcurrencyLimits.NET</RepositoryUrl>
22+
<RepositoryType>git</RepositoryType>
23+
<PackageTags>concurrency;rate-limiting;load-shedding;adaptive-concurrency;congestion-control;aspnetcore;grpc;resilience</PackageTags>
24+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
25+
<IncludeSymbols>true</IncludeSymbols>
26+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
27+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
28+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
29+
</PropertyGroup>
30+
31+
<ItemGroup Condition="'$(IsPackable)' != 'false'">
32+
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" />
33+
</ItemGroup>
1134
</Project>

0 commit comments

Comments
 (0)