diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 603ac9f..4922ff5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ Thank you for your interest in contributing to MaksIT.Core! This document provid ```bash cd src -dotnet build MaksIT.Core.sln +dotnet build MaksIT.Core.slnx ``` ### Running Tests @@ -246,4 +246,4 @@ If the release partially failed (e.g., NuGet succeeded but GitHub failed): ## License -By contributing, you agree that your contributions will be licensed under the MIT License. +By contributing, you agree that your contributions are licensed under the terms in `LICENSE.md`. diff --git a/README.md b/README.md index d0213ef..86b9638 100644 --- a/README.md +++ b/README.md @@ -1614,7 +1614,10 @@ string completedName = completed.GetDisplayName(); // "Completed" ## Contact -For any inquiries or contributions, feel free to reach out: +If you have any questions or need further assistance, feel free to reach out: -- **Email**: maksym.sadovnychyy@gmail.com -- **Author**: Maksym Sadovnychyy (MAKS-IT) \ No newline at end of file +- **Email**: [maksym.sadovnychyy@gmail.com](mailto:maksym.sadovnychyy@gmail.com) + +## License + +See `LICENSE.md`. \ No newline at end of file diff --git a/src/MaksIT.Core.sln b/src/MaksIT.Core.sln deleted file mode 100644 index d10e2d8..0000000 --- a/src/MaksIT.Core.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.002.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MaksIT.Core", "MaksIT.Core\MaksIT.Core.csproj", "{4AE39520-D4F7-4C5F-ACE9-9E79AEAF3228}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaksIT.Core.Tests", "MaksIT.Core.Tests\MaksIT.Core.Tests.csproj", "{B67A43DA-AFFC-4510-8D51-08F1FF84CC5B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4AE39520-D4F7-4C5F-ACE9-9E79AEAF3228}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4AE39520-D4F7-4C5F-ACE9-9E79AEAF3228}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4AE39520-D4F7-4C5F-ACE9-9E79AEAF3228}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4AE39520-D4F7-4C5F-ACE9-9E79AEAF3228}.Release|Any CPU.Build.0 = Release|Any CPU - {B67A43DA-AFFC-4510-8D51-08F1FF84CC5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B67A43DA-AFFC-4510-8D51-08F1FF84CC5B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B67A43DA-AFFC-4510-8D51-08F1FF84CC5B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B67A43DA-AFFC-4510-8D51-08F1FF84CC5B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9BCC72D1-8BE8-4924-AF73-C8E86E16EC59} - EndGlobalSection -EndGlobal diff --git a/src/MaksIT.Core.slnx b/src/MaksIT.Core.slnx new file mode 100644 index 0000000..6114519 --- /dev/null +++ b/src/MaksIT.Core.slnx @@ -0,0 +1,4 @@ + + + + diff --git a/utils/Force-AmendTaggedCommit/Force-AmendTaggedCommit.ps1 b/utils/Force-AmendTaggedCommit/Force-AmendTaggedCommit.ps1 index ca2a8b0..bca2946 100644 --- a/utils/Force-AmendTaggedCommit/Force-AmendTaggedCommit.ps1 +++ b/utils/Force-AmendTaggedCommit/Force-AmendTaggedCommit.ps1 @@ -66,6 +66,29 @@ Import-Module $gitToolsModulePath -Force #endregion +#region Helpers + +function Select-PreferredHeadTag { + param( + [Parameter(Mandatory = $true)] + [string[]]$Tags + ) + + # Pick the latest tag on HEAD by git's own ordering (no tag-name parsing assumptions). + $ordered = (& git tag --points-at HEAD --sort=-creatordate 2>$null) + if ($LASTEXITCODE -eq 0 -and $ordered) { + $orderedTags = @($ordered | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } | ForEach-Object { $_.Trim() }) + if ($orderedTags.Count -gt 0) { + return $orderedTags[0] + } + } + + # Fallback: keep script functional even if sorting is unavailable. + return $Tags[0] +} + +#endregion + #region Load Settings $settings = Get-ScriptSettings -ScriptDir $scriptDir @@ -116,8 +139,11 @@ if ($tags.Count -eq 0) { exit 1 } -# If multiple tags exist, use the first one returned by git. -$TagName = $tags[0] +# If multiple tags exist, choose the latest one on HEAD by git ordering. +if ($tags.Count -gt 1) { + Write-Log -Level "WARN" -Message "Multiple tags found on HEAD: $($tags -join ', ')" +} +$TagName = Select-PreferredHeadTag -Tags $tags Write-Log -Level "OK" -Message "Found tag: $TagName" # 4. Inspect pending changes before amend diff --git a/utils/Release-NuGetPackage/Release-NuGetPackage.ps1 b/utils/Release-NuGetPackage/Release-NuGetPackage.ps1 index 2bf1c50..abd9e6e 100644 --- a/utils/Release-NuGetPackage/Release-NuGetPackage.ps1 +++ b/utils/Release-NuGetPackage/Release-NuGetPackage.ps1 @@ -716,6 +716,10 @@ if (Test-Path $testResultsDir) { Remove-Item $testResultsDir -Recurse -Force Write-Log -Level "INFO" -Message " Cleaned up test results directory." } + +Get-ChildItem -Path $releaseDir -File | + Where-Object { $_.Name -like "*$version*.nupkg" -or $_.Name -like "*$version*.snupkg" } | + Remove-Item -Force -ErrorAction SilentlyContinue #endregion #region Summary