From ceb001d415fbaf0fd5423b1bb57113f9337d292f Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:00:48 -0500 Subject: [PATCH] Add release automation, bump version to 0.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update CI workflow to build on Windows, trigger on releases, and auto-package/upload PerformanceStudio and CLI zips with checksums - Bump App version 0.7.0 → 0.8.0, CLI version 0.5.0 → 0.8.0 - Fix CLI product name from "SQL Performance Studio" to "Performance Studio" Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 59 ++++++++++++++++++++++-- src/PlanViewer.App/PlanViewer.App.csproj | 2 +- src/PlanViewer.Cli/PlanViewer.Cli.csproj | 4 +- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7732715..c3564b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,19 @@ -name: CI +name: Build on: push: branches: [main] pull_request: - branches: [main] + branches: [main, dev] + release: + types: [created, published] + +permissions: + contents: write jobs: build-and-test: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v4 @@ -34,3 +39,51 @@ jobs: - name: Run tests run: dotnet test tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj -c Release --no-build --verbosity normal + + - name: Get version + id: version + shell: pwsh + run: | + $version = ([xml](Get-Content src/PlanViewer.App/PlanViewer.App.csproj)).Project.PropertyGroup.Version | Where-Object { $_ } + echo "VERSION=$version" >> $env:GITHUB_OUTPUT + + - name: Publish App + run: dotnet publish src/PlanViewer.App/PlanViewer.App.csproj -c Release -o publish/App + + - name: Publish CLI + run: dotnet publish src/PlanViewer.Cli/PlanViewer.Cli.csproj -c Release -o publish/Cli + + - name: Package release artifacts + if: github.event_name == 'release' + shell: pwsh + run: | + $version = "${{ steps.version.outputs.VERSION }}" + New-Item -ItemType Directory -Force -Path releases + + # App ZIP + if (Test-Path 'README.md') { Copy-Item 'README.md' 'publish/App/' } + if (Test-Path 'LICENSE') { Copy-Item 'LICENSE' 'publish/App/' } + Compress-Archive -Path 'publish/App/*' -DestinationPath "releases/PerformanceStudio-$version.zip" -Force + + # CLI ZIP + if (Test-Path 'LICENSE') { Copy-Item 'LICENSE' 'publish/Cli/' } + Compress-Archive -Path 'publish/Cli/*' -DestinationPath "releases/PerformanceStudioCli-$version.zip" -Force + + - name: Generate checksums + if: github.event_name == 'release' + shell: pwsh + run: | + $checksums = Get-ChildItem releases/*.zip | ForEach-Object { + $hash = (Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLower() + "$hash $($_.Name)" + } + $checksums | Out-File -FilePath releases/SHA256SUMS.txt -Encoding utf8 + Write-Host "Checksums:" + $checksums | ForEach-Object { Write-Host $_ } + + - name: Upload release assets + if: github.event_name == 'release' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload ${{ github.event.release.tag_name }} releases/*.zip releases/SHA256SUMS.txt --clobber diff --git a/src/PlanViewer.App/PlanViewer.App.csproj b/src/PlanViewer.App/PlanViewer.App.csproj index 95b9541..6845665 100644 --- a/src/PlanViewer.App/PlanViewer.App.csproj +++ b/src/PlanViewer.App/PlanViewer.App.csproj @@ -5,7 +5,7 @@ enable app.manifest true - 0.7.0 + 0.8.0 Erik Darling Darling Data LLC Performance Studio diff --git a/src/PlanViewer.Cli/PlanViewer.Cli.csproj b/src/PlanViewer.Cli/PlanViewer.Cli.csproj index 3776e12..d6b863e 100644 --- a/src/PlanViewer.Cli/PlanViewer.Cli.csproj +++ b/src/PlanViewer.Cli/PlanViewer.Cli.csproj @@ -11,10 +11,10 @@ enable PlanViewer.Cli planview - 0.5.0 + 0.8.0 Erik Darling Darling Data LLC - SQL Performance Studio + Performance Studio Copyright (c) 2026 Erik Darling, Darling Data LLC