From 0ae79ffc77c732e206ae98a613c6888549707828 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Fri, 25 Aug 2023 15:47:25 +0200 Subject: [PATCH 1/4] Simplify version setting in build workflow Removed the separate step for updating version in the release workflow. Consolidated the version setting into the build step using "-p:Version=${{ inputs.version }}". This change simplifies the workflow and ensures the version is set in a single, consistent manner across different jobs. --- .github/workflows/build.yml | 2 +- .github/workflows/release-template.yml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea8b9c3e..9f7ff85b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: - name: ๐Ÿ›’ Checkout repository uses: actions/checkout@v3 - name: ๐Ÿ› ๏ธ Build - run: dotnet build src/Refitter.sln -c Release -p:UseSourceLink=true -p:PackageVersion="${{ env.VERSION }}" + run: dotnet build -c Release src/Refitter.sln -p:UseSourceLink=true -p:PackageVersion="${{ env.version }}" -p:Version="${{ env.version }}" - name: ๐Ÿงช Test run: dotnet test src/Refitter.sln -c Release - name: ๐Ÿ—ณ๏ธ Upload diff --git a/.github/workflows/release-template.yml b/.github/workflows/release-template.yml index 7ed83b53..69517759 100644 --- a/.github/workflows/release-template.yml +++ b/.github/workflows/release-template.yml @@ -22,12 +22,8 @@ jobs: uses: dotnet/nbgv@master with: setAllVars: true - - name: Update Version - run: ((Get-Content -Path Refitter.Core.csproj -Raw) -Replace "1.0.0", "${{ inputs.version }}") | Set-Content -Path Refitter.Core.csproj - working-directory: src/Refitter.Core/ - shell: pwsh - name: Build - run: dotnet build -c Release src/Refitter.sln -p:UseSourceLink=true -p:PackageVersion="${{ inputs.version }}" + run: dotnet build -c Release src/Refitter.sln -p:UseSourceLink=true -p:PackageVersion="${{ inputs.version }}" -p:Version="${{ inputs.version }}" - name: Move packages shell: pwsh run: Get-ChildItem -Filter *.nupkg -Recurse | ForEach-Object { Move-Item -Path $_ -Destination . } From 5fc6206c930ccfef246cde72f5bfa8e8299c4093 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Fri, 25 Aug 2023 15:47:49 +0200 Subject: [PATCH 2/4] Add assembly version to GenerateCommand output A change has been made to the 'GenerateCommand.cs' file in order to enrich the console output information. The assembly version is now printed when the GenerateCommand is executed. This will aid in debugging and support scenarios, as users and developers can easily check the version of the software running. --- src/Refitter/GenerateCommand.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Refitter/GenerateCommand.cs b/src/Refitter/GenerateCommand.cs index aeed7f90..55d75f00 100644 --- a/src/Refitter/GenerateCommand.cs +++ b/src/Refitter/GenerateCommand.cs @@ -45,6 +45,7 @@ public override async Task ExecuteAsync(CommandContext context, Settings se try { var stopwatch = Stopwatch.StartNew(); + AnsiConsole.MarkupLine($"[green]Version: {GetType().Assembly.GetName().Version!}[/]"); AnsiConsole.MarkupLine($"[green]Support key: {SupportInformation.GetSupportKey()}[/]"); if (!string.IsNullOrWhiteSpace(settings.SettingsFilePath)) From c494ca3e836b5156a4ad6585c20d47f2499e1547 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Fri, 25 Aug 2023 15:49:27 +0200 Subject: [PATCH 3/4] Update version display string in GenerateCommand GenerateCommand's version display was changed from a simple version number to a more descriptive string that includes the app's name, "Refitter". This will make the output more informative and clear to users. --- src/Refitter/GenerateCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Refitter/GenerateCommand.cs b/src/Refitter/GenerateCommand.cs index 55d75f00..68c33077 100644 --- a/src/Refitter/GenerateCommand.cs +++ b/src/Refitter/GenerateCommand.cs @@ -45,7 +45,7 @@ public override async Task ExecuteAsync(CommandContext context, Settings se try { var stopwatch = Stopwatch.StartNew(); - AnsiConsole.MarkupLine($"[green]Version: {GetType().Assembly.GetName().Version!}[/]"); + AnsiConsole.MarkupLine($"[green]Refitter v{GetType().Assembly.GetName().Version!}[/]"); AnsiConsole.MarkupLine($"[green]Support key: {SupportInformation.GetSupportKey()}[/]"); if (!string.IsNullOrWhiteSpace(settings.SettingsFilePath)) From 521a0d1a917bbb173027313892d21e881026350f Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Fri, 25 Aug 2023 15:51:38 +0200 Subject: [PATCH 4/4] Update environment variable casing in build file In the build step of the Github Actions workflow file, the casing of the 'version' environment variable was updated from 'env.version' to 'env.VERSION'. This ensures consistency with the conventions of environment variables typically being in uppercase. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f7ff85b..b1af1b03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: - name: ๐Ÿ›’ Checkout repository uses: actions/checkout@v3 - name: ๐Ÿ› ๏ธ Build - run: dotnet build -c Release src/Refitter.sln -p:UseSourceLink=true -p:PackageVersion="${{ env.version }}" -p:Version="${{ env.version }}" + run: dotnet build -c Release src/Refitter.sln -p:UseSourceLink=true -p:PackageVersion="${{ env.VERSION }}" -p:Version="${{ env.VERSION }}" - name: ๐Ÿงช Test run: dotnet test src/Refitter.sln -c Release - name: ๐Ÿ—ณ๏ธ Upload