Skip to content

Commit 768c961

Browse files
authored
Merge pull request #7 from thangchung/feat/building-blocks-nuget
2 parents 3b345af + 6f80504 commit 768c961

File tree

8 files changed

+94
-4
lines changed

8 files changed

+94
-4
lines changed

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: NuGet Generation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [closed]
9+
branches:
10+
- master
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-18.04
15+
name: Update NuGet package
16+
steps:
17+
18+
- name: Checkout repository
19+
uses: actions/checkout@v1
20+
21+
- name: Setup .NET Core @ Latest
22+
uses: actions/setup-dotnet@v1
23+
with:
24+
dotnet-version: 5.0.201
25+
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
26+
env:
27+
NUGET_AUTH_TOKEN: ${{ secrets.PRACTICAL_CLEAN_DDD_TOKEN }}
28+
29+
- name: Build solution and generate NuGet package
30+
run: |
31+
printenv
32+
echo "${{ env.GITHUB_RUN_ID}}"
33+
dotnet pack src/BuildingBlocks/N8T.Core/N8T.Core.csproj -c Release --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID -o out
34+
dotnet pack src/BuildingBlocks/N8T.Infrastructure/N8T.Infrastructure.csproj -c Release --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID -o out
35+
dotnet pack src/BuildingBlocks/N8T.Infrastructure.EfCore/N8T.Infrastructure.EfCore.csproj -c Release --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID -o out
36+
dotnet pack src/BuildingBlocks/N8T.Infrastructure.OTel/N8T.Infrastructure.OTel.csproj -c Release --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID -o out
37+
38+
- name: Push generated package to GitHub registry
39+
run: dotnet nuget push /home/runner/work/practical-clean-ddd/practical-clean-ddd/out/*.nupkg --api-key ${{ secrets.PRACTICAL_CLEAN_DDD_TOKEN }} --skip-duplicate
40+
env:
41+
NUGET_AUTH_TOKEN: ${{ secrets.PRACTICAL_CLEAN_DDD_TOKEN }}

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,33 @@ public class OutboxEntity
243243

244244
- Dapr provider
245245

246+
# Private `nuget` for NetCoreKit
247+
248+
Fork this repository!
249+
250+
Set global nuget for accessing in Visual Studio
251+
252+
```
253+
# edit C:\Users\<current user>\AppData\Roaming\NuGet\NuGet.Config
254+
255+
```
256+
257+
```xml
258+
<?xml version="1.0" encoding="utf-8"?>
259+
<configuration>
260+
<packageSources>
261+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
262+
<add key="github" value="https://nuget.pkg.github.com/thangchung/index.json" />
263+
</packageSources>
264+
<packageSourceCredentials>
265+
<github>
266+
<add key="Username" value="<your github username>" />
267+
<add key="ClearTextPassword" value="<Github Token>" />
268+
</github>
269+
</packageSourceCredentials>
270+
</configuration>
271+
```
272+
246273
# Sample pages
247274

248275
![](assets/products_screen.png)

nuget.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
<packageSources>
44
<clear />
55
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
6+
<add key="github" value="https://nuget.pkg.github.com/thangchung/index.json" />
67
</packageSources>
78
</configuration>

src/BuildingBlocks/N8T.Core/N8T.Core.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<Import Project="..\packages.props" />
4+
35
<PropertyGroup>
46
<TargetFramework>net5.0</TargetFramework>
57
<LangVersion>preview</LangVersion>

src/BuildingBlocks/N8T.Infrastructure.EfCore/N8T.Infrastructure.EfCore.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<Import Project="..\packages.props" />
4+
35
<PropertyGroup>
46
<TargetFramework>net5.0</TargetFramework>
57
<LangVersion>preview</LangVersion>
68
</PropertyGroup>
7-
9+
810
<ItemGroup>
911
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.2" />
1012
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.2" />
1113
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.2" />
1214
<PackageReference Include="EFCore.NamingConventions" Version="5.0.2" />
1315
</ItemGroup>
14-
16+
1517
<ItemGroup>
1618
<ProjectReference Include="..\N8T.Core\N8T.Core.csproj" />
1719
<ProjectReference Include="..\N8T.Infrastructure\N8T.Infrastructure.csproj" />

src/BuildingBlocks/N8T.Infrastructure.OTel/N8T.Infrastructure.OTel.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<Import Project="..\packages.props" />
4+
35
<PropertyGroup>
46
<TargetFramework>net5.0</TargetFramework>
57
<LangVersion>preview</LangVersion>
68
</PropertyGroup>
7-
9+
810
<ItemGroup>
911
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
1012
<PackageReference Include="OpenTelemetry" Version="1.0.0-rc1.1" />
@@ -17,7 +19,7 @@
1719
<PackageReference Include="OpenTelemetry.Instrumentation.SqlClient" Version="1.0.0-rc1.1" />
1820
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.0.0-rc1.1" />
1921
</ItemGroup>
20-
22+
2123
<ItemGroup>
2224
<ProjectReference Include="..\N8T.Infrastructure\N8T.Infrastructure.csproj" />
2325
</ItemGroup>

src/BuildingBlocks/N8T.Infrastructure/N8T.Infrastructure.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<Import Project="..\packages.props" />
4+
35
<PropertyGroup>
46
<TargetFramework>net5.0</TargetFramework>
57
<LangVersion>preview</LangVersion>

src/BuildingBlocks/packages.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<Product>N8T</Product>
5+
<Authors>Thang Chung</Authors>
6+
<RepositoryType>git</RepositoryType>
7+
<RepositoryUrl>https://github.com/thangchung/practical-clean-ddd.git</RepositoryUrl>
8+
<PackageProjectUrl>https://github.com/thangchung/practical-clean-ddd</PackageProjectUrl>
9+
<PackageLicenseUrl>https://github.com/thangchung/practical-clean-ddd/blob/master/LICENSE</PackageLicenseUrl>
10+
<Copyright>Copyright (c) Thang Chung - 2021</Copyright>
11+
</PropertyGroup>
12+
13+
</Project>

0 commit comments

Comments
 (0)