Skip to content

Commit

Permalink
Merge branch 'main' into topic/move-cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHinsh authored Jul 25, 2024
2 parents aa725a0 + a84742b commit 59960e1
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
shell: pwsh
if: ${{ steps.Build.outcome == 'success' }}
run: |
.\build\packageExtension.ps1 -version ${{ env.GitVersion_MajorMinorPatch }}.${{ env.GitVersion_PreReleaseNumber }} -outfolder "./staging"
.\build\packageExtension.ps1 -version ${{ env.GitVersion_AssemblySemVer }} -outfolder "./staging"
- name: "List Package Files"
shell: pwsh
if: ${{ steps.Build.outcome == 'success' }}
Expand Down
95 changes: 95 additions & 0 deletions docs/Reference/Generated/MigrationTools.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/MigrationTools/MigrationTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

<ItemGroup>
<PackageReference Include="Elmah.Io.Client" Version="5.1.76" />
<PackageReference Include="GitInfo" Version="3.3.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
Expand Down
9 changes: 8 additions & 1 deletion src/MigrationTools/Services/TelemetryClientAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ public static (Version version, string PreReleaseLabel, string versionString) Ge
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly()?.Location);
var matches = Regex.Matches(myFileVersionInfo.ProductVersion, @"^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<build>0|[1-9]\d*)(?:-((?<label>:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<fullEnd>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$");
Version version = new Version(myFileVersionInfo.FileVersion);
string textVersion = version.Major + "." + version.Minor + "." + version.Build + "-" + matches[0].Groups[1].Value;
string textVersion = "0.0.0-local";
if (version.CompareTo(new Version(0, 0, 0, 0)) == 0)
{
textVersion = ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch + "-" + matches[0].Groups[1].Value;
} else
{
textVersion = version.Major + "." + version.Minor + "." + version.Build + "-" + matches[0].Groups[1].Value;
}
return (version, matches[0].Groups[1].Value, textVersion);
}
}
Expand Down

0 comments on commit 59960e1

Please sign in to comment.