Skip to content

Commit 5a05ec4

Browse files
committed
nuget
1 parent 8f1ec6d commit 5a05ec4

3 files changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish NuGet Packages
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Trigger on version tags like v1.0.0
7+
workflow_dispatch: # Allow manual triggering
8+
9+
env:
10+
DOTNET_VERSION: '10.0.x' # Use .NET 10.0 for building
11+
12+
jobs:
13+
build-and-publish:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: ${{ env.DOTNET_VERSION }}
24+
25+
- name: Restore dependencies
26+
run: dotnet restore
27+
28+
- name: Build solution
29+
run: dotnet build --configuration Release --no-restore
30+
31+
- name: Run tests
32+
run: dotnet test --configuration Release --no-build --verbosity normal
33+
34+
- name: Pack NuGet packages
35+
run: dotnet pack --configuration Release --no-build --output ./nupkgs
36+
37+
- name: Publish Dapper.Unnest package to NuGet
38+
run: dotnet nuget push "./nupkgs/Dapper.Unnest.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
39+
40+
- name: Create GitHub Release
41+
if: startsWith(github.ref, 'refs/tags/v')
42+
uses: actions/create-release@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
tag_name: ${{ github.ref }}
47+
release_name: Release ${{ github.ref }}
48+
body: |
49+
## What's Changed
50+
51+
### NuGet Package
52+
- `Dapper.Unnest` - Complete package with attributes and source generator
53+
54+
### Installation
55+
```bash
56+
dotnet add package Dapper.Unnest
57+
```
58+
59+
### Documentation
60+
See [README.md](https://github.com/abakumovoleg/dapper.unnested/blob/main/README.md) for usage instructions.
61+
draft: false
62+
prerelease: false

Dapper.Unnest.Generator/Dapper.Unnest.Generator.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,29 @@
77
<Nullable>enable</Nullable>
88
<IsAnalyzer>true</IsAnalyzer>
99
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
10+
11+
<!-- NuGet Package Properties for Analyzer -->
12+
<PackageId>Dapper.Unnest.Generator</PackageId>
13+
<Version>1.0.0</Version>
14+
<Authors>abakumovoleg</Authors>
15+
<Company>abakumovoleg</Company>
16+
<Description>Source generator for Dapper.Unnest package. Automatically generates extension methods to "unnest" collections of objects into arrays.</Description>
17+
<PackageTags>dapper;source-generator;analyzer;bulk-operations</PackageTags>
18+
<RepositoryUrl>https://github.com/abakumovoleg/dapper.unnested</RepositoryUrl>
19+
<RepositoryType>git</RepositoryType>
20+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
21+
<DevelopmentDependency>true</DevelopmentDependency>
22+
<IncludeBuildOutput>false</IncludeBuildOutput>
23+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
1024
</PropertyGroup>
1125

1226
<ItemGroup>
1327
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" PrivateAssets="all" />
1428
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
1529
</ItemGroup>
1630

31+
<ItemGroup>
32+
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
33+
</ItemGroup>
34+
1735
</Project>

Dapper.Unnest/Dapper.Unnest.csproj

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7+
8+
<!-- NuGet Package Properties -->
9+
<PackageId>Dapper.Unnest</PackageId>
10+
<Version>1.0.0</Version>
11+
<Authors>abakumovoleg</Authors>
12+
<Company>abakumovoleg</Company>
13+
<Description>A C# source generator that automatically generates extension methods to "unnest" collections of objects into arrays for each property. This is particularly useful for Dapper bulk operations where you need to pass arrays of values for each column.</Description>
14+
<PackageTags>dapper;source-generator;bulk-operations;arrays;collections</PackageTags>
15+
<RepositoryUrl>https://github.com/abakumovoleg/dapper.unnested</RepositoryUrl>
16+
<RepositoryType>git</RepositoryType>
17+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
18+
<PackageReadmeFile>README.md</PackageReadmeFile>
19+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
720
</PropertyGroup>
821

22+
<ItemGroup>
23+
<ProjectReference Include="..\Dapper.Unnest.Generator\Dapper.Unnest.Generator.csproj" PrivateAssets="all" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<None Include="..\README.md" Pack="true" PackagePath="" />
28+
</ItemGroup>
29+
930
</Project>

0 commit comments

Comments
 (0)