diff --git a/.github/workflows/deploy-web.yml b/.github/workflows/deploy-web.yml
index 412d720..bbaed60 100644
--- a/.github/workflows/deploy-web.yml
+++ b/.github/workflows/deploy-web.yml
@@ -6,6 +6,7 @@ on:
paths:
- 'src/PlanViewer.Core/**'
- 'src/PlanViewer.Web/**'
+ - 'src/PlanViewer.App/PlanViewer.App.csproj'
- '.github/workflows/deploy-web.yml'
workflow_dispatch:
@@ -36,6 +37,17 @@ jobs:
- name: Install WASM workload
run: dotnet workload install wasm-tools
+ - name: Sync web version with app version
+ shell: pwsh
+ run: |
+ $appVersion = ([xml](Get-Content src/PlanViewer.App/PlanViewer.App.csproj)).Project.PropertyGroup.Version | Where-Object { $_ }
+ Write-Host "App version: $appVersion"
+ $webCsproj = 'src/PlanViewer.Web/PlanViewer.Web.csproj'
+ $content = Get-Content $webCsproj -Raw
+ $content = [regex]::Replace($content, '
Paste or upload a .sqlplan file. Your plan XML never leaves your browser.
-Powered by the same analysis engine in the Performance Studio app.
+Powered by the same analysis engine in the Performance Studio app. @AppVersion
@if (errorMessage != null) { @@ -57,6 +57,7 @@ else { } + @if (shareUrl != null) { @@ -1664,6 +1665,13 @@ else @code { private const string ShareApiBase = "https://stats.erikdarling.com"; + private static readonly string AppVersion = GetAppVersion(); + private static string GetAppVersion() + { + var v = typeof(Index).Assembly.GetName().Version; + return v == null ? "?" : $"v{v.Major}.{v.Minor}.{v.Build}"; + } + private string activeTab = "paste"; private string planXml = ""; private string? errorMessage; diff --git a/src/PlanViewer.Web/PlanViewer.Web.csproj b/src/PlanViewer.Web/PlanViewer.Web.csproj index 1c136af..7d83410 100644 --- a/src/PlanViewer.Web/PlanViewer.Web.csproj +++ b/src/PlanViewer.Web/PlanViewer.Web.csproj @@ -5,7 +5,7 @@