From e8d86e80246b492184a0bb04e9a71ad0794fd206 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 16 Jun 2024 21:28:31 +0200 Subject: [PATCH] Fixed handling of versions on Windows --- .github/workflows/build-and-release.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 3ce4fbbe..99b84784 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -114,9 +114,22 @@ jobs: $app_version = Get-Content metadata.txt -TotalCount 1 $build_time = Get-Content metadata.txt -TotalCount 2 | Select-Object -Last 1 $build_number = Get-Content metadata.txt -TotalCount 3 | Select-Object -Last 1 - $dotnet_sdk_version = Get-Content metadata.txt -TotalCount 4 | Select-Object -Last 1 - $dotnet_runtime_version = Get-Content metadata.txt -TotalCount 5 | Select-Object -Last 1 - $rust_version = Get-Content metadata.txt -TotalCount 6 | Select-Object -Last 1 + + # Next line is the .NET SDK version. + # The format is '8.0.205 (commit 3e1383b780)'. + # We extract only the version number, though: + $dotnet_sdk_version = ((Get-Content -Path 'metadata.txt')[3] -match '(\d+\.\d+\.\d+)') | Out-Null; $matches[1] + + # Next line is the .NET runtime version. + # The format is '8.0.5 (commit 087e15321b)'. + # We extract only the version number, though: + $dotnet_runtime_version = ((Get-Content -Path 'metadata.txt')[4] -match '(\d+\.\d+\.\d+)') | Out-Null; $matches[1] + + # Next line is the Rust version. + # The format is '1.78.0 (commit 9b00956e5)'. + # We extract only the version number, though: + $rust_version = ((Get-Content -Path 'metadata.txt')[5] -match '(\d+\.\d+\.\d+)') | Out-Null; $matches[1] + $mud_blazor_version = Get-Content metadata.txt -TotalCount 7 | Select-Object -Last 1 $tauri_version = Get-Content metadata.txt -TotalCount 8 | Select-Object -Last 1