From abe41b673666b4085dc44f7ee5e3426cf33bcb56 Mon Sep 17 00:00:00 2001 From: Ryan Kelly <94ryan.kelly@gmail.com> Date: Wed, 2 Sep 2026 09:32:18 +0100 Subject: [PATCH 1/3] feat(ci): add preview slot support for WebGL export and deployment --- .github/scripts/deploy-vercel.ps1 | 26 ++++++++++++++++---------- .github/workflows/web-export.yml | 10 +++++++++- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/scripts/deploy-vercel.ps1 b/.github/scripts/deploy-vercel.ps1 index bba8cd8..cb9eddb 100644 --- a/.github/scripts/deploy-vercel.ps1 +++ b/.github/scripts/deploy-vercel.ps1 @@ -6,7 +6,7 @@ # docs/WEB_EXPORT.md. # # Inputs (environment): -# EVENT_NAME, GIT_REF, IN_TARGET (blank = preview), ALIAS_PREVIEW, BUILD_COMMIT, VERCEL_TOKEN +# EVENT_NAME, GIT_REF, IN_TARGET (blank = preview), ALIAS_PREVIEW, SLOT_NUMBER, BUILD_COMMIT, VERCEL_TOKEN Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' @@ -15,11 +15,14 @@ $PSNativeCommandUseErrorActionPreference = $true Copy-Item infra/vercel/vercel.json build/web/vercel.json -Force npm i -g vercel@latest -# Target is STATED, not inferred from the ref. It used to be "main means --prod", -# which made a dispatch the wrong branch away from silently publishing to -# maze.ryankelly.dev -- an unacceptable footgun now that agents dispatch this -# workflow to get preview URLs (see docs/BUILD_VERIFICATION.md). -$target = if ($env:EVENT_NAME -eq 'push') { 'production' } +# Determine if this deploy targets a preview slot (slot/1..3) +$slot = if ($env:GIT_REF -match '^refs/heads/slot/([0-9]+)$') { $Matches[1] } + elseif (![string]::IsNullOrWhiteSpace($env:SLOT_NUMBER)) { $env:SLOT_NUMBER } + else { $null } + +# Target is STATED, not inferred from the ref. +$target = if ($env:EVENT_NAME -eq 'push' -and $env:GIT_REF -eq 'refs/heads/main') { 'production' } + elseif ($slot) { 'slot' } elseif ([string]::IsNullOrWhiteSpace($env:IN_TARGET)) { 'preview' } else { $env:IN_TARGET } @@ -33,10 +36,13 @@ if ($target -eq 'production') { $url = (vercel deploy build/web --yes --token=$env:VERCEL_TOKEN) | Select-Object -Last 1 } -# ALIAS_PREVIEW=true pins this deploy to the stable bisect/inspection URL -# preview-maze.ryankelly.dev. Preview-only by design: production already has its own -# alias, and pinning a prod deploy here would silently repurpose the bisect URL. -if ($env:ALIAS_PREVIEW -eq 'true') { +# Alias preview slot if slot is specified (e.g. p1.maze.ryankelly.dev) +if ($slot) { + $aliasDomain = "p$slot.maze.ryankelly.dev" + vercel alias set $url $aliasDomain --token=$env:VERCEL_TOKEN + Write-Host "DEPLOY_ALIAS=https://$aliasDomain" +} elseif ($env:ALIAS_PREVIEW -eq 'true') { + # ALIAS_PREVIEW=true pins this deploy to preview-maze.ryankelly.dev if ($target -ne 'preview') { throw "alias_preview=true is only valid with deploy_target=preview (got $target)." } diff --git a/.github/workflows/web-export.yml b/.github/workflows/web-export.yml index f189c23..1846b2a 100644 --- a/.github/workflows/web-export.yml +++ b/.github/workflows/web-export.yml @@ -22,7 +22,7 @@ name: Web Export & Deploy on: push: - branches: [main] + branches: [main, "slot/*"] paths: - "scripts/**" - "scenes/**" @@ -47,6 +47,12 @@ on: default: "preview" type: choice options: ["preview", "production"] + slot: + description: "Preview slot (1..3) to alias this deployment (e.g. 1 -> p1.maze.ryankelly.dev)" + required: false + default: "" + type: choice + options: ["", "1", "2", "3"] godot_fork_tag: description: "Override patched-editor release tag (blank = .github/web-toolchain.env)" required: false @@ -112,6 +118,7 @@ jobs: GIT_REF: ${{ github.ref }} IN_TARGET: ${{ github.event.inputs.deploy_target }} ALIAS_PREVIEW: ${{ github.event.inputs.alias_preview }} + SLOT_NUMBER: ${{ github.event.inputs.slot }} BUILD_COMMIT: ${{ steps.export.outputs.build_commit }} run: '& "$env:GITHUB_WORKSPACE/.github/scripts/deploy-vercel.ps1"' @@ -262,6 +269,7 @@ jobs: # commandeer the stable preview-maze.ryankelly.dev bisect alias. IN_TARGET: "preview" ALIAS_PREVIEW: "false" + SLOT_NUMBER: "" EVENT_NAME: ${{ github.event_name }} GIT_REF: ${{ github.ref }} BUILD_COMMIT: ${{ steps.export.outputs.build_commit }} From 44eca99582bb860b87cd241e483456c88985ad0a Mon Sep 17 00:00:00 2001 From: Ryan Kelly <94ryan.kelly@gmail.com> Date: Wed, 2 Sep 2026 09:34:54 +0100 Subject: [PATCH 2/3] feat(ci): remove legacy preview alias in favor of p1..p3 slots --- .github/scripts/deploy-vercel.ps1 | 9 +-------- .github/workflows/web-export.yml | 7 ------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/scripts/deploy-vercel.ps1 b/.github/scripts/deploy-vercel.ps1 index cb9eddb..e89ab1d 100644 --- a/.github/scripts/deploy-vercel.ps1 +++ b/.github/scripts/deploy-vercel.ps1 @@ -6,7 +6,7 @@ # docs/WEB_EXPORT.md. # # Inputs (environment): -# EVENT_NAME, GIT_REF, IN_TARGET (blank = preview), ALIAS_PREVIEW, SLOT_NUMBER, BUILD_COMMIT, VERCEL_TOKEN +# EVENT_NAME, GIT_REF, IN_TARGET (blank = preview), SLOT_NUMBER, BUILD_COMMIT, VERCEL_TOKEN Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' @@ -41,13 +41,6 @@ if ($slot) { $aliasDomain = "p$slot.maze.ryankelly.dev" vercel alias set $url $aliasDomain --token=$env:VERCEL_TOKEN Write-Host "DEPLOY_ALIAS=https://$aliasDomain" -} elseif ($env:ALIAS_PREVIEW -eq 'true') { - # ALIAS_PREVIEW=true pins this deploy to preview-maze.ryankelly.dev - if ($target -ne 'preview') { - throw "alias_preview=true is only valid with deploy_target=preview (got $target)." - } - vercel alias set $url preview-maze.ryankelly.dev --token=$env:VERCEL_TOKEN - Write-Host "DEPLOY_ALIAS=https://preview-maze.ryankelly.dev" } "url=$url" >> $env:GITHUB_OUTPUT diff --git a/.github/workflows/web-export.yml b/.github/workflows/web-export.yml index 1846b2a..454ee93 100644 --- a/.github/workflows/web-export.yml +++ b/.github/workflows/web-export.yml @@ -61,11 +61,6 @@ on: description: "Override export-template folder name (blank = .github/web-toolchain.env)" required: false default: "" - alias_preview: - description: "Alias this deploy to preview-maze.ryankelly.dev (for bisecting old commits without touching prod)" - type: boolean - required: false - default: false issue_comment: types: [created] @@ -117,7 +112,6 @@ jobs: EVENT_NAME: ${{ github.event_name }} GIT_REF: ${{ github.ref }} IN_TARGET: ${{ github.event.inputs.deploy_target }} - ALIAS_PREVIEW: ${{ github.event.inputs.alias_preview }} SLOT_NUMBER: ${{ github.event.inputs.slot }} BUILD_COMMIT: ${{ steps.export.outputs.build_commit }} run: '& "$env:GITHUB_WORKSPACE/.github/scripts/deploy-vercel.ps1"' @@ -268,7 +262,6 @@ jobs: # ALIAS_PREVIEW likewise: a /preview gets its own throwaway URL and must not # commandeer the stable preview-maze.ryankelly.dev bisect alias. IN_TARGET: "preview" - ALIAS_PREVIEW: "false" SLOT_NUMBER: "" EVENT_NAME: ${{ github.event_name }} GIT_REF: ${{ github.ref }} From fce2046c3dc441215fa8a1d178773c813872cd08 Mon Sep 17 00:00:00 2001 From: Ryan Kelly <94ryan.kelly@gmail.com> Date: Mon, 26 Oct 2026 10:11:05 +0000 Subject: [PATCH 3/3] feat(ci): enforce ban on .sh and .ps1 scripts via ls-lint --- .github/workflows/test.yml | 6 ++++++ .ls-lint.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .ls-lint.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b50cac..2f331cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,9 @@ jobs: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Verify no banned scripts (.sh / .ps1) + uses: ls-lint/action@a87c5eb4fb26d7af1bd0adba203dd1e76f7e94eb # v2.3.2 + - name: Set up .NET 9 SDK uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: @@ -57,6 +60,9 @@ jobs: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Verify no banned scripts (.sh / .ps1) + uses: ls-lint/action@a87c5eb4fb26d7af1bd0adba203dd1e76f7e94eb # v2.3.2 + - name: Set up .NET 9 SDK uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: diff --git a/.ls-lint.yml b/.ls-lint.yml new file mode 100644 index 0000000..4c73a1a --- /dev/null +++ b/.ls-lint.yml @@ -0,0 +1,31 @@ +# .ls-lint.yml +# Estate-wide ban on shell (.sh, .bash, .zsh) and PowerShell (.ps1, .psm1) scripts. +# Exceptions must be explicitly listed in the `ignore:` section below. + +ls: + .sh: exists:0 + .bash: exists:0 + .zsh: exists:0 + .ps1: exists:0 + .psm1: exists:0 + "**": + .sh: exists:0 + .bash: exists:0 + .zsh: exists:0 + .ps1: exists:0 + .psm1: exists:0 + +ignore: + - .git + - .venv + - node_modules + - temp + - .temp + - .worktrees + - bin + - obj + - dist + - build + # Explicit repository exceptions: + - .github/actions/export-web/scripts/** + - .github/scripts/**