Switch to MinVer, add CI/CD, unify thumbnail options
- Add .gitlab-ci.yml for Windows CI/CD: build, publish, and GitLab Release with artifact upload - Replace GitVersion.MsBuild with MinVer for versioning; update all versioning logic in .csproj - Remove GitVersion CLI fallback for Visual Studio builds - Update post-publish renaming to use MinVer's Version property - Replace multiple thumbnail text checkboxes with a single ComboBox selector in MainWindow.xaml - Change default UI startup: prefer WPF MainWindow, fallback to WinForms MainForm
This commit is contained in:
parent
d13ec8abdf
commit
da9d9875b0
4 changed files with 94 additions and 45 deletions
|
|
@ -46,21 +46,19 @@
|
|||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.3" />
|
||||
<PackageReference Include="GitVersion.MsBuild" Version="6.5.1" PrivateAssets="all" />
|
||||
<PackageReference Include="MinVer" Version="3.0.0" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- If GitVersion ran and produced values, prefer them for assembly/file/informational version
|
||||
so the built assembly exposes FullSemVer for runtime and the publish rename uses the same value. -->
|
||||
<!-- If MinVer ran and produced values, prefer them for assembly/file/informational version
|
||||
so the built assembly exposes the computed version for runtime and the publish rename uses the same value. -->
|
||||
<PropertyGroup>
|
||||
<!-- AssemblyVersion uses AssemblySemVer when available (three-part) -->
|
||||
<AssemblyVersion Condition="'$(GitVersion_AssemblySemVer)' != ''">$(GitVersion_AssemblySemVer)</AssemblyVersion>
|
||||
<!-- FileVersion uses GitVersion FileVersion when available -->
|
||||
<FileVersion Condition="'$(GitVersion_FileVersion)' != ''">$(GitVersion_FileVersion)</FileVersion>
|
||||
<!-- Prefer FullSemVer for informational version -->
|
||||
<InformationalVersion Condition="'$(GitVersion_FullSemVer)' != ''">$(GitVersion_FullSemVer)</InformationalVersion>
|
||||
<!-- Prefer explicit MSBuild 'Version' set by MinVer when available -->
|
||||
<AssemblyVersion Condition="'$(Version)' != ''">$(Version)</AssemblyVersion>
|
||||
<FileVersion Condition="'$(Version)' != ''">$(Version)</FileVersion>
|
||||
<InformationalVersion Condition="'$(Version)' != ''">$(Version)</InformationalVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
|
|
@ -76,18 +74,7 @@
|
|||
</ItemGroup>
|
||||
<PropertyGroup />
|
||||
|
||||
<!-- When building inside Visual Studio (which runs .NET Framework MSBuild), the GitVersion.MsBuild
|
||||
task (net8.0) may fail. Run the GitVersion CLI as a fallback to produce obj/gitversion.json so
|
||||
subsequent targets can consume the same values. Developers should install the global tool:
|
||||
dotnet tool install __global GitVersion.Tool __version 6.5.1
|
||||
-->
|
||||
<Target Name="RunGitVersionCliForVisualStudio" BeforeTargets="GenerateAssemblyInfo" Condition="'$(BuildingInsideVisualStudio)' == 'true'">
|
||||
<Message Text="Building inside Visual Studio: attempting to run GitVersion CLI to generate obj\gitversion.json (if `dotnet-gitversion` is installed)." Importance="High" />
|
||||
<!-- Try the typical global tool command. ContinueOnError=true so VS build doesn't fail if CLI is not installed. -->
|
||||
<Exec Command="dotnet-gitversion -output file -outputfile "$(ProjectDir)obj\gitversion.json"" ContinueOnError="true" />
|
||||
<!-- Also try 'dotnet tool run' in case a local tool manifest is used. -->
|
||||
<Exec Command="dotnet tool run GitVersion.Tool -- -output file -outputfile "$(ProjectDir)obj\gitversion.json"" ContinueOnError="true" />
|
||||
</Target>
|
||||
<!-- No Visual Studio fallback required for MinVer; MinVer integrates with MSBuild during build. -->
|
||||
|
||||
<!-- After publish, rename the produced executable to ImageCatalog.<year>.<major>.<minor>.<build>.<revision>.<ext>
|
||||
The destination extension is taken from the actual produced file (exe or dll).
|
||||
|
|
@ -95,9 +82,9 @@
|
|||
<Target Name="RenamePublishedExeWithYearAndVersion" AfterTargets="Publish" Condition="'$(PublishDir)' != ''">
|
||||
<PropertyGroup>
|
||||
<_PublishYear>$([System.DateTime]::Now.ToString("yyyy"))</_PublishYear>
|
||||
<!-- Prefer GitVersion FullSemVer, then FileVersion, then AssemblyVersion -->
|
||||
<_Ver Condition="'$(GitVersion_FullSemVer)' != ''">$(GitVersion_FullSemVer)</_Ver>
|
||||
<_Ver Condition="'$(GitVersion_FullSemVer)' == ''">$(FileVersion)</_Ver>
|
||||
<!-- Prefer MinVer/MSBuild 'Version', then FileVersion, then AssemblyVersion -->
|
||||
<_Ver Condition="'$(Version)' != ''">$(Version)</_Ver>
|
||||
<_Ver Condition="'$(Version)' == ''">$(FileVersion)</_Ver>
|
||||
<_Ver Condition="'$(_Ver)' == ''">$(AssemblyVersion)</_Ver>
|
||||
|
||||
<!-- Normalize to avoid spaces but keep plus signs for pre-release build metadata; replace spaces with underscore -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue