Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 25 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'

outputs:
version: ${{ steps.gitversion.outputs.semVer }}
version: ${{ steps.nbgv.outputs.SemVer2 }}
should-publish: ${{ steps.check-version.outputs.should-publish }}

steps:
Expand All @@ -161,45 +161,46 @@ jobs:
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
versionSpec: '6.x'
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install Nerdbank.GitVersioning
run: dotnet tool install --global nbgv

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v1
with:
useConfigFile: true
configFilePath: GitVersion.yml
id: nbgv
run: |
nbgv cloud
echo "SemVer2=$(nbgv get-version -v SemVer2)" >> $GITHUB_OUTPUT
echo "NuGetPackageVersion=$(nbgv get-version -v NuGetPackageVersion)" >> $GITHUB_OUTPUT
echo "AssemblyVersion=$(nbgv get-version -v AssemblyVersion)" >> $GITHUB_OUTPUT
echo "FileVersion=$(nbgv get-version -v AssemblyFileVersion)" >> $GITHUB_OUTPUT
echo "InformationalVersion=$(nbgv get-version -v AssemblyInformationalVersion)" >> $GITHUB_OUTPUT
echo "PrereleaseVersion=$(nbgv get-version -v PrereleaseVersion)" >> $GITHUB_OUTPUT

- name: Check if version should be published
id: check-version
run: |
SHOULD_PUBLISH="false"

# Check if this is a release version (not prerelease)
if [[ "${{ steps.gitversion.outputs.preReleaseLabel }}" == "" ]]; then
# PrereleaseVersion is empty for release versions, contains prerelease label otherwise
if [[ "${{ steps.nbgv.outputs.PrereleaseVersion }}" == "" ]]; then
SHOULD_PUBLISH="true"
fi

# Check if tag already exists
if git rev-parse "v${{ steps.gitversion.outputs.semVer }}" >/dev/null 2>&1; then
echo "Tag v${{ steps.gitversion.outputs.semVer }} already exists, skipping publish"
if git rev-parse "v${{ steps.nbgv.outputs.SemVer2 }}" >/dev/null 2>&1; then
echo "Tag v${{ steps.nbgv.outputs.SemVer2 }} already exists, skipping publish"
SHOULD_PUBLISH="false"
fi

echo "should-publish=$SHOULD_PUBLISH" >> $GITHUB_OUTPUT
echo "Version: ${{ steps.gitversion.outputs.semVer }}"
echo "Version: ${{ steps.nbgv.outputs.SemVer2 }}"
echo "Should publish: $SHOULD_PUBLISH"

- name: Setup .NET
if: steps.check-version.outputs.should-publish == 'true'
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
cache: true

- name: Restore dependencies
if: steps.check-version.outputs.should-publish == 'true'
run: dotnet restore ${{ env.SOLUTION_NAME }}
Expand All @@ -209,21 +210,15 @@ jobs:
run: |
dotnet build ${{ env.SOLUTION_NAME }} \
--no-restore \
--configuration Release \
/p:Version=${{ steps.gitversion.outputs.semVer }} \
/p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemVer }} \
/p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} \
/p:InformationalVersion=${{ steps.gitversion.outputs.informationalVersion }}
--configuration Release

- name: Pack NuGet packages
if: steps.check-version.outputs.should-publish == 'true'
run: |
dotnet pack ${{ env.SOLUTION_NAME }} \
--no-build \
--configuration Release \
--output ./artifacts \
/p:PackageVersion=${{ steps.gitversion.outputs.semVer }} \
/p:Version=${{ steps.gitversion.outputs.semVer }}
--output ./artifacts

- name: Publish to NuGet.org
if: steps.check-version.outputs.should-publish == 'true'
Expand All @@ -245,8 +240,8 @@ jobs:
if: steps.check-version.outputs.should-publish == 'true'
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.gitversion.outputs.semVer }}
name: Release v${{ steps.gitversion.outputs.semVer }}
tag: v${{ steps.nbgv.outputs.SemVer2 }}
name: Release v${{ steps.nbgv.outputs.SemVer2 }}
artifacts: "./artifacts/*.nupkg"
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand All @@ -112,6 +114,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.113" PrivateAssets="all" />
</ItemGroup>
</Project>
105 changes: 0 additions & 105 deletions GitVersion.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
<ProjectReference Include="..\..\src\JD.Domain.Runtime\JD.Domain.Runtime.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
<ProjectReference Include="..\..\src\JD.Domain.Snapshot\JD.Domain.Snapshot.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
<ProjectReference Include="..\..\src\JD.Domain.Snapshot\JD.Domain.Snapshot.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
Expand Down
1 change: 1 addition & 0 deletions src/JD.Domain.Abstractions/JD.Domain.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/JD.Domain.AspNetCore/JD.Domain.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/JD.Domain.Cli/JD.Domain.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.1" />
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/JD.Domain.Configuration/JD.Domain.Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<ProjectReference Include="..\JD.Domain.Modeling\JD.Domain.Modeling.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
Expand Down
1 change: 1 addition & 0 deletions src/JD.Domain.Diff/JD.Domain.Diff.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/JD.Domain.EFCore/JD.Domain.EFCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.1" />
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentValidation" Version="11.11.0" />
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
<PackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="all" />
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down Expand Up @@ -31,6 +31,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
<PackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="all" />
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand All @@ -23,6 +23,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/JD.Domain.Modeling/JD.Domain.Modeling.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<ProjectReference Include="..\JD.Domain.Abstractions\JD.Domain.Abstractions.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
Expand Down
Loading
Loading