Skip to content

Commit 6f47d02

Browse files
feat: add central management for nuget packages to chapter 3 (#216)
1 parent 6adef48 commit 6f47d02

File tree

42 files changed

+592
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+592
-197
lines changed

.github/workflows/chapter-3-contracts-package-workflow.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ name: Contracts package workflow
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
paths:
7-
- 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/**'
7+
- "Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/**"
88
pull_request:
9-
branches: [ "main" ]
9+
branches: ["main"]
1010
paths:
11-
- 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/**'
11+
- "Chapter-3-microservice-extraction/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/**"
1212

1313
env:
14-
CHAPTER_DIR: 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src'
15-
NUGET_SOURCE_NAME: "evolutionaryArchitecture"
14+
CHAPTER_DIR: "Chapter-3-microservice-extraction/Fitnet.Contracts/Src"
15+
NUGET_SOURCE_NAME: "EvolutionaryArchitecture"
1616

1717
jobs:
1818
build:
@@ -22,22 +22,22 @@ jobs:
2222
runs-on: ubuntu-latest
2323
name: Build
2424
steps:
25-
- uses: actions/checkout@v3
26-
- name: Setup .NET
27-
uses: actions/setup-dotnet@v3
28-
with:
29-
dotnet-version: 9.0.x
30-
- name: Add Evolutionary Architecture Nuget Source
31-
uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main
32-
with:
25+
- uses: actions/checkout@v3
26+
- name: Setup .NET
27+
uses: actions/setup-dotnet@v3
28+
with:
29+
dotnet-version: 9.0.x
30+
- name: Add Evolutionary Architecture Nuget Source
31+
uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main
32+
with:
3333
github-token: ${{ secrets.GITHUB_TOKEN }}
3434
owner: ${{ github.repository_owner }}
3535
path: ${{ env.CHAPTER_DIR }}
3636
nuget-source-name: ${{ env.NUGET_SOURCE_NAME }}
37-
- name: Restore dependencies
38-
run: dotnet restore
39-
- name: Build
40-
run: dotnet build --no-restore
37+
- name: Restore dependencies
38+
run: dotnet restore
39+
- name: Build
40+
run: dotnet build --no-restore
4141

4242
pack:
4343
defaults:
@@ -48,19 +48,19 @@ jobs:
4848
if: github.ref == 'refs/heads/main'
4949
name: Pack and Publish
5050
steps:
51-
- uses: actions/checkout@v3
52-
- name: Setup .NET
53-
uses: actions/setup-dotnet@v3
54-
with:
55-
dotnet-version: 9.0.x
56-
- name: Add Evolutionary Architecture Nuget Source
57-
uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main
58-
with:
51+
- uses: actions/checkout@v3
52+
- name: Setup .NET
53+
uses: actions/setup-dotnet@v3
54+
with:
55+
dotnet-version: 9.0.x
56+
- name: Add Evolutionary Architecture Nuget Source
57+
uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main
58+
with:
5959
github-token: ${{ secrets.GITHUB_TOKEN }}
6060
owner: ${{ github.repository_owner }}
6161
path: ${{ env.CHAPTER_DIR }}
6262
nuget-source-name: ${{ env.NUGET_SOURCE_NAME }}
63-
- name: Pack Project
64-
run: dotnet pack Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj -c Release
65-
- name: Publish Packages
66-
run: dotnet nuget push "Fitnet.Contracts.IntegrationEvents/bin/Release/EvolutionaryArchitecture.Fitnet.Contracts.IntegrationEvents.*.nupkg" --source ${{ env.NUGET_SOURCE_NAME }} --api-key ${{ secrets.GITHUB_TOKEN }}
63+
- name: Pack Project
64+
run: dotnet pack Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj -c Release
65+
- name: Publish Packages
66+
run: dotnet nuget push "Fitnet.Contracts.IntegrationEvents/bin/Release/EvolutionaryArchitecture.Fitnet.Contracts.IntegrationEvents.*.nupkg" --source ${{ env.NUGET_SOURCE_NAME }} --api-key ${{ secrets.GITHUB_TOKEN }}

.github/workflows/chapter-3-contracts-workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111

1212
env:
1313
CHAPTER_DIR: "Chapter-3-microservice-extraction/Fitnet.Contracts/Src"
14-
NUGET_SOURCE_NAME: "evolutionaryArchitecture"
15-
14+
NUGET_SOURCE_NAME: "EvolutionaryArchitecture"
15+
1616
jobs:
1717
build:
1818
defaults:

.github/workflows/chapter-3-package-workflow.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ name: Chapter 3 package workflow
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
paths:
7-
- 'Chapter-3-microservice-extraction/Fitnet.Common/**'
7+
- "Chapter-3-microservice-extraction/Fitnet.Common/**"
88
pull_request:
9-
branches: [ "main" ]
9+
branches: ["main"]
1010
paths:
11-
- 'Chapter-3-microservice-extraction/Fitnet.Common/**'
11+
- "Chapter-3-microservice-extraction/Fitnet.Common/**"
1212

1313
env:
14-
CHAPTER_DIR: 'Chapter-3-microservice-extraction/Fitnet.Common'
15-
NUGET_SOURCE_NAME: "evolutionaryArchitecture"
14+
CHAPTER_DIR: "Chapter-3-microservice-extraction/Fitnet.Common"
15+
NUGET_SOURCE_NAME: "EvolutionaryArchitecture"
1616

17-
jobs:
17+
jobs:
1818
build:
1919
defaults:
2020
run:
@@ -31,7 +31,7 @@ jobs:
3131
run: dotnet restore
3232
- name: Build
3333
run: dotnet build --no-restore
34-
34+
3535
test:
3636
defaults:
3737
run:
@@ -51,7 +51,7 @@ jobs:
5151
- name: Test
5252
run: dotnet test
5353

54-
pack:
54+
pack:
5555
defaults:
5656
run:
5757
working-directory: ${{ env.CHAPTER_DIR }}
@@ -65,7 +65,7 @@ jobs:
6565
uses: actions/setup-dotnet@v3
6666
with:
6767
dotnet-version: 9.0.x
68-
68+
6969
- name: Pack Projects
7070
run: |
7171
dotnet pack Fitnet.Common.Api/Fitnet.Common.Api.csproj -c Release
@@ -80,7 +80,7 @@ jobs:
8080
owner: ${{ github.repository_owner }}
8181
path: ${{ env.CHAPTER_DIR }}
8282
nuget-source-name: ${{ env.NUGET_SOURCE_NAME }}
83-
83+
8484
- name: Publish Packages
8585
run: |
8686
dotnet nuget push "Fitnet.Common.Api/bin/Release/EvolutionaryArchitecture.Fitnet.Common.Api.*.nupkg" --source ${{ env.NUGET_SOURCE_NAME }} --api-key ${{ secrets.GITHUB_TOKEN }}

.github/workflows/chapter-3-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
env:
1414
CHAPTER_DIR: "Chapter-3-microservice-extraction/Fitnet/Src"
15-
NUGET_SOURCE_NAME: "evolutionaryArchitecture"
15+
NUGET_SOURCE_NAME: "EvolutionaryArchitecture"
1616

1717
jobs:
1818
build:

Chapter-3-microservice-extraction/Fitnet.Common/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1313
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1414
<RepositoryUrl>https://github.com/evolutionary-architecture/evolutionary-architecture-by-example</RepositoryUrl>
15-
<Version>3.2.5</Version>
15+
<Version>3.3.0</Version>
1616
</PropertyGroup>
1717

1818
<ItemGroup>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup Label="Production">
6+
<PackageVersion Include="FluentValidation" Version="12.0.0" />
7+
<PackageVersion Include="JetBrains.Annotations" Version="2025.2.2" />
8+
<PackageVersion Include="MassTransit" Version="8.3.2" />
9+
<PackageVersion Include="MediatR" Version="12.5.0" />
10+
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0" />
11+
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.9" />
12+
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.9" />
13+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
14+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.9" />
15+
</ItemGroup>
16+
<ItemGroup Label="Tests">
17+
<PackageVersion Include="Bogus" Version="35.6.3" />
18+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
19+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.9" />
20+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
21+
<PackageVersion Include="Shouldly" Version="4.3.0" />
22+
<PackageVersion Include="Testcontainers" Version="4.7.0" />
23+
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.7.0" />
24+
<PackageVersion Include="Verify.Xunit" Version="30.17.0" />
25+
<PackageVersion Include="xunit" Version="2.9.3" />
26+
<PackageVersion Include="xunit.analyzers" Version="1.24.0" />
27+
<PackageVersion Include="xunit.categories" Version="2.0.8" />
28+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
29+
</ItemGroup>
30+
<ItemGroup>
31+
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.15.0.120848" PrivateAssets="all" Condition="$(MSBuildProjectExtension) == '.csproj'" />
32+
</ItemGroup>
33+
</Project>

Chapter-3-microservice-extraction/Fitnet.Common/Fitnet.Common.Api.UnitTests/Fitnet.Common.Api.UnitTests.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="FluentAssertions" Version="6.12.2" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
14-
<PackageReference Include="Shouldly" Version="4.3.0" />
15-
<PackageReference Include="xunit" Version="2.9.2" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
13+
<PackageReference Include="Shouldly" />
14+
<PackageReference Include="xunit" />
15+
<PackageReference Include="xunit.runner.visualstudio">
1716
<PrivateAssets>all</PrivateAssets>
1817
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1918
</PackageReference>

Chapter-3-microservice-extraction/Fitnet.Common/Fitnet.Common.Api/Fitnet.Common.Api.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</ItemGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="FluentValidation" Version="11.11.0" />
8+
<PackageReference Include="FluentValidation" />
99
</ItemGroup>
1010

1111
<ItemGroup>

Chapter-3-microservice-extraction/Fitnet.Common/Fitnet.Common.Core.UnitTests/Fitnet.Common.Core.UnitTests.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="FluentAssertions" Version="6.12.2" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
14-
<PackageReference Include="Shouldly" Version="4.3.0" />
15-
<PackageReference Include="xunit" Version="2.9.2" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
13+
<PackageReference Include="Shouldly" />
14+
<PackageReference Include="xunit" />
15+
<PackageReference Include="xunit.runner.visualstudio">
1716
<PrivateAssets>all</PrivateAssets>
1817
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1918
</PackageReference>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<ItemGroup>
4-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
4+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
55
</ItemGroup>
66

77
</Project>

0 commit comments

Comments
 (0)