Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitVersion in the tool #1726

Merged
merged 5 commits into from
Nov 9, 2023
Merged

Use GitVersion in the tool #1726

merged 5 commits into from
Nov 9, 2023

Conversation

MrHinsh
Copy link
Member

@MrHinsh MrHinsh commented Nov 8, 2023

When showing the version number in the log file we want to be able to also show a version number when folks are debugging locally. I added https://github.com/devlooped/GitInfo from @devlooped to enable this.

We then add either the assembly version or the latest Git tag!

 private static string GetVersionTextForLog()
 {
     Version runningVersion = DetectVersionService2.GetRunningVersion();
     string textVersion = ((runningVersion.Major > 1) ? "$v" + runningVersion : ThisAssembly.Git.BaseTag.Replace("v", "") + "-local");
     return textVersion;
 }

This ensures that the version is shown on the log as either:

  • Running locally in debug: [18:20:56 DBG] [v14.2.1-2-local] Hosting starting
  • Running from Winget/Choco/portable: [18:20:56 DBG] [v14.2.1] Hosting starting

Either way, we can determine the version of the running code and how many local commits they have made.

image

@MrHinsh MrHinsh temporarily deployed to nakedalmweb-githubSDK November 8, 2023 18:22 — with GitHub Actions Inactive
@MrHinsh MrHinsh temporarily deployed to nakedalmweb-githubSDK November 8, 2023 18:29 — with GitHub Actions Inactive
@MrHinsh MrHinsh temporarily deployed to nakedalmweb-githubSDK November 8, 2023 18:39 — with GitHub Actions Inactive
@MrHinsh MrHinsh temporarily deployed to nakedalmweb-githubSDK November 9, 2023 10:36 — with GitHub Actions Inactive
@MrHinsh MrHinsh merged commit e09eca9 into master Nov 9, 2023
6 checks passed
@MrHinsh MrHinsh deleted the gitVersion branch November 9, 2023 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant