diff --git a/.github/workflows/deploy-planshare.yml b/.github/workflows/deploy-planshare.yml index feab0130..048fba4f 100644 --- a/.github/workflows/deploy-planshare.yml +++ b/.github/workflows/deploy-planshare.yml @@ -3,6 +3,8 @@ name: Deploy PlanShare # PlanShare is not built by ci.yml (server/** is paths-ignored) and is not in # PlanViewer.sln, so before this workflow existed a merged PR shipped nothing. # Production once drifted ~3.5 months behind main, missing two security fixes. +# The stats page (dashboard.html, robots.txt) drifted the same way: it was +# never shipped at all and sat on an April copy until 2026-11-25. on: push: branches: [main] @@ -26,6 +28,7 @@ env: DEPLOY_HOST: stats.erikdarling.com DEPLOY_USER: deploy APP_DIR: /opt/planshare + WEB_ROOT: /var/www/stats PUBLIC_URL: https://stats.erikdarling.com jobs: @@ -139,3 +142,59 @@ jobs: - name: Clean up key if: always() run: rm -f ~/.ssh/deploy_key + + # The stats page is static: nginx serves WEB_ROOT and proxies only /api/ to + # the app. It ships in its own job, so a failure here can neither block the + # binary deploy nor trigger its rollback. Root owns WEB_ROOT; the deploy user + # owns only index.html and robots.txt in it, so scp overwrites those two + # files in place and cannot add or remove anything else. + deploy-page: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Configure SSH + env: + DEPLOY_KEY: ${{ secrets.PLANSHARE_DEPLOY_KEY }} + run: | + if [ -z "$DEPLOY_KEY" ]; then + echo "::error::PLANSHARE_DEPLOY_KEY secret is not set - cannot deploy." + exit 1 + fi + mkdir -p ~/.ssh && chmod 700 ~/.ssh + printf '%s\n' "$DEPLOY_KEY" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + # Pinned host key: fail closed rather than trusting on first use. + echo 'stats.erikdarling.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICIrnTBiPVE5ulZiFZTBw9/DR/dPVwbAr8ZIvu47/w2J' > ~/.ssh/known_hosts + chmod 600 ~/.ssh/known_hosts + + - name: Upload page files + run: | + scp -i ~/.ssh/deploy_key -o BatchMode=yes \ + server/PlanShare/dashboard.html \ + "$DEPLOY_USER@$DEPLOY_HOST:$WEB_ROOT/index.html" + # robots.txt is optional, so a tree without it still ships the page. + if [ -f server/PlanShare/robots.txt ]; then + scp -i ~/.ssh/deploy_key -o BatchMode=yes \ + server/PlanShare/robots.txt \ + "$DEPLOY_USER@$DEPLOY_HOST:$WEB_ROOT/robots.txt" + fi + + - name: Verify through nginx + run: | + # The bytes nginx serves must match the repo file exactly. + verify() { + want=$(sha256sum < "$1" | cut -d' ' -f1) + got=$(curl -sSf -m 20 "$PUBLIC_URL$2" | sha256sum | cut -d' ' -f1) + echo "$2: repo $want, served $got" + [ "$want" = "$got" ] || { echo "::error::$PUBLIC_URL$2 does not match $1"; return 1; } + } + verify server/PlanShare/dashboard.html / + if [ -f server/PlanShare/robots.txt ]; then + verify server/PlanShare/robots.txt /robots.txt + fi + + - name: Clean up key + if: always() + run: rm -f ~/.ssh/deploy_key diff --git a/.github/workflows/deploy-web.yml b/.github/workflows/deploy-web.yml index 1676d3ae..7c9b2e92 100644 --- a/.github/workflows/deploy-web.yml +++ b/.github/workflows/deploy-web.yml @@ -14,19 +14,18 @@ on: permissions: contents: read - pages: write - id-token: write concurrency: group: pages cancel-in-progress: true jobs: - deploy: + # Build and deploy are separate jobs. In one job, deploy-pages can list the + # run's artifacts a fraction of a second after upload-pages-artifact finalizes + # and find none (actions/deploy-pages#451), and re-running that job uploads a + # second github-pages artifact, which deploy-pages also rejects. + build: runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -56,6 +55,18 @@ jobs: with: path: publish/wwwroot + deploy: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 23fd9cda..d85b5bbc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -4,7 +4,7 @@ name: Nightly Build # # The token that can write to the repository never sits next to build-time code (the same rule # as dependency-submission.yml): -# check contents: read. Skips the build when dev has no commit from the last 24 hours. +# check contents: read. Skips the build when dev's tip is the commit the nightly tag points at. # build contents: read. Restores, tests and publishes the App (package and MSBuild code runs # here), packages the zips and SHA256SUMS.txt, and uploads releases/ as an artifact. # publish contents: write. Checks out nothing and runs no repository code. It downloads the @@ -31,16 +31,22 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Check for new commits in last 24 hours + # Build when dev's tip differs from the commit the nightly tag points at. + # fetch-depth: 0 also fetches tags. A "commits in the last 24 hours" + # window skipped new commits whenever GitHub started the scheduled run + # later in the day than the run before (start times drift by hours). + # A missing tag (deleted by a publish that failed half way) means build. + - name: Check whether dev moved since the last nightly id: check run: | - RECENT=$(git log --since="24 hours ago" --oneline | head -1) - if [ -n "$RECENT" ]; then - echo "has_changes=true" >> $GITHUB_OUTPUT - echo "New commits found — building nightly" + HEAD_SHA=$(git rev-parse HEAD) + NIGHTLY_SHA=$(git rev-parse -q --verify 'refs/tags/nightly^{commit}' || true) + if [ "$HEAD_SHA" != "$NIGHTLY_SHA" ]; then + echo "has_changes=true" >> "$GITHUB_OUTPUT" + echo "dev is at $HEAD_SHA, nightly is at ${NIGHTLY_SHA:-none}: building nightly" else - echo "has_changes=false" >> $GITHUB_OUTPUT - echo "No new commits — skipping nightly build" + echo "has_changes=false" >> "$GITHUB_OUTPUT" + echo "Nightly is already built from $HEAD_SHA: skipping" fi build: @@ -117,6 +123,7 @@ jobs: if (Test-Path 'README.md') { Copy-Item 'README.md' 'publish/linux-x64/' } if (Test-Path 'LICENSE') { Copy-Item 'LICENSE' 'publish/linux-x64/' } python .github/scripts/zip_with_exec.py publish/linux-x64 "releases/PerformanceStudio-linux-x64-$env:VERSION.zip" --exec PlanViewer.App --exec-optional createdump + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # Package macOS as proper .app bundles foreach ($rid in @('osx-x64', 'osx-arm64')) { @@ -148,6 +155,7 @@ jobs: # Zip the bundle with zip_with_exec.py so the apphost inside the .app # keeps its execute bit (Compress-Archive would strip it). python .github/scripts/zip_with_exec.py "$wrapperDir" "releases/PerformanceStudio-$rid-$env:VERSION.zip" --exec "PerformanceStudio.app/Contents/MacOS/PlanViewer.App" --exec-optional "PerformanceStudio.app/Contents/MacOS/createdump" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } } - name: Generate checksums diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6c6b17d..8b6003a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -194,7 +194,7 @@ jobs: # fix the cause and start a fresh run (a new dev -> main merge) instead of # re-running the same one. - name: Sign Windows build - uses: signpath/github-action-submit-signing-request@4a84eb4ad763290f059275786f2deed97c2c672b # v3.1 + uses: signpath/github-action-submit-signing-request@a2c5b60d9c75f073142b653c354b632eedce097b # v3.2 with: api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' organization-id: '7969f8b6-d946-4a74-9bac-a55856d8b8e0' @@ -276,7 +276,7 @@ jobs: # artifact would sign nothing and still succeed, and the collect step # refuses to stage an empty set for that reason. - name: Sign the executables Velopack generates - uses: signpath/github-action-submit-signing-request@4a84eb4ad763290f059275786f2deed97c2c672b # v3.1 + uses: signpath/github-action-submit-signing-request@a2c5b60d9c75f073142b653c354b632eedce097b # v3.2 with: api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' organization-id: '7969f8b6-d946-4a74-9bac-a55856d8b8e0' @@ -342,7 +342,7 @@ jobs: id: sign-ssms if: steps.ssms.outputs.BUILT == 'true' continue-on-error: true - uses: signpath/github-action-submit-signing-request@4a84eb4ad763290f059275786f2deed97c2c672b # v3.1 + uses: signpath/github-action-submit-signing-request@a2c5b60d9c75f073142b653c354b632eedce097b # v3.2 with: api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' organization-id: '7969f8b6-d946-4a74-9bac-a55856d8b8e0' diff --git a/CITATION.cff b/CITATION.cff index 108db710..57729c01 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -9,8 +9,8 @@ authors: website: "https://erikdarling.com" repository-code: "https://github.com/erikdarlingdata/PerformanceStudio" license: MIT -version: "1.32.0" -date-released: "2026-11-22" +version: "1.33.0" +date-released: "2026-12-01" keywords: - sql-server - execution-plan diff --git a/Directory.Packages.props b/Directory.Packages.props index 2cdb41df..74bf1177 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,22 +5,22 @@ - + - - - - + + + + - + - - + + + + Darling Data - GitHub Stats + + + + + + + + + + + + + @@ -29,9 +49,9 @@ .header-divider { width: 1px; height: 20px; background: #555; } .header-title { font-family: 'Montserrat', sans-serif; font-size: 1rem; - font-weight: 600; color: #ffffff; letter-spacing: 0.3px; + font-weight: 600; color: #ffffff; letter-spacing: 0.3px; white-space: nowrap; } - .header-nav { display: flex; gap: 1.5rem; margin-left: auto; } + .header-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 1rem; margin-left: auto; } .header-nav a { color: #e0e0e0; text-decoration: none; font-size: 1rem; font-weight: 500; padding: 0.3rem 0.6rem; border-radius: 4px; transition: all 0.15s; @@ -68,11 +88,16 @@ .prerelease { font-size: 0.7em; background: #341a00; color: #d29922; padding: 2px 6px; border-radius: 10px; margin-left: 6px; } footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid #21262d; color: #484f58; font-size: 0.8em; text-align: center; padding-bottom: 20px; } footer a { color: #58a6ff; text-decoration: none; } + @media (max-width: 1100px) { + .header-nav { gap: 0.25rem 0.5rem; } + .header-nav a { font-size: 0.9rem; padding: 0.25rem 0.4rem; } + } @media (max-width: 768px) { .site-header { padding: 0.6rem 1rem; } .header-title { display: none; } .header-divider { display: none; } - .header-nav { gap: 0.5rem; } + .header-content { flex-wrap: wrap; } + .header-nav { gap: 0.25rem 0.5rem; margin-left: 0; justify-content: flex-start; } .header-nav a { font-size: 0.85rem; padding: 0.2rem 0.4rem; } .charts-grid { grid-template-columns: 1fr; } .stats-row { grid-template-columns: repeat(2, 1fr); } @@ -80,16 +105,23 @@ -