Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/windows-fork-qualification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Windows fork qualification

on:
push:
branches: [qualification/windows-package]

permissions:
contents: read

jobs:
package:
if: github.repository == 'InTheta/t3code'
runs-on: windows-2025
timeout-minutes: 45
env:
T3_QUALIFICATION_SHA: ${{ github.sha }}
CSC_IDENTITY_AUTO_DISCOVERY: "false"
steps:
- name: Check out the pinned public source
shell: pwsh
run: |
git init
if ($LASTEXITCODE -ne 0) { throw "Git initialization failed" }
git config core.longpaths true
if ($LASTEXITCODE -ne 0) { throw "Git long-path setup failed" }
git fetch --no-tags --depth=1 https://github.com/InTheta/t3code.git $env:T3_QUALIFICATION_SHA
if ($LASTEXITCODE -ne 0) { throw "Pinned source fetch failed" }
git checkout --detach FETCH_HEAD
if ($LASTEXITCODE -ne 0) { throw "Pinned source checkout failed" }
- uses: ./.github/actions/setup-ci-deps
with:
install-args: --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
- name: Verify source and prepare the MSVC target
shell: pwsh
run: |
if ((git rev-parse HEAD) -ne $env:T3_QUALIFICATION_SHA) {
throw "Unexpected qualification source commit"
}
rustup target add x86_64-pc-windows-msvc
# The shared Vite+ cache publishes its Windows executable to Git Bash.
- name: Build the Windows x64 installer
id: package
shell: bash
run: |
export TEMP="$RUNNER_TEMP"
export TMP="$RUNNER_TEMP"
vp run dist:desktop:win:x64 --keep-stage --output-dir "$RUNNER_TEMP/t3-windows-qualification"
- name: Record rejected payload inventory
if: failure() && steps.package.outcome == 'failure'
shell: pwsh
run: |
$stage = @(Get-ChildItem -LiteralPath $env:RUNNER_TEMP -Directory -Filter 't3code-desktop-win-stage-*')
if ($stage.Count -ne 1) { throw "Expected one retained package staging directory" }
$payload = @(Get-ChildItem -LiteralPath (Join-Path $stage[0].FullName 'app/dist') -Directory -Filter '*-unpacked')
if ($payload.Count -ne 1) { throw "Expected one unpacked Windows payload" }
$files = Get-ChildItem -LiteralPath $payload[0].FullName -File -Recurse -Force | ForEach-Object {
[pscustomobject]@{path=[IO.Path]::GetRelativePath($payload[0].FullName,$_.FullName).Replace('\','/');bytes=$_.Length}
}
$files | Sort-Object path | ConvertTo-Json | Set-Content "$env:RUNNER_TEMP/t3-rejected-payload.json"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: failure() && steps.package.outcome == 'failure'
with:
name: t3-rejected-payload-inventory
path: ${{ runner.temp }}/t3-rejected-payload.json
if-no-files-found: error
retention-days: 7
- name: Record installer identity
shell: pwsh
run: |
$output = "$env:RUNNER_TEMP/t3-windows-qualification"
$installer = @(Get-ChildItem -LiteralPath $output -Filter '*.exe' -File)
if ($installer.Count -ne 1) { throw "Expected one Windows installer" }
$hash = Get-FileHash -Algorithm SHA256 -LiteralPath $installer[0].FullName
"$($hash.Hash.ToLowerInvariant()) $($installer[0].Name)" | Set-Content "$output/SHA256SUMS.txt"
$env:T3_QUALIFICATION_SHA | Set-Content "$output/SOURCE-SHA.txt"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: t3-windows-x64-qualification
path: |
${{ runner.temp }}/t3-windows-qualification/*.exe
${{ runner.temp }}/t3-windows-qualification/SHA256SUMS.txt
${{ runner.temp }}/t3-windows-qualification/SOURCE-SHA.txt
if-no-files-found: error
retention-days: 7
1 change: 1 addition & 0 deletions scripts/lib/server-compile-cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { expect, it } from "vite-plus/test";
import { cacheKey, seedPreparedCache } from "./server-compile-cache.ts";

it.each([
{ platform: "win32", hostArch: "x64", arch: 1, reason: "Windows installer cache" },
{ platform: "freebsd", hostArch: "x64", arch: 1, reason: "unsupported target freebsd" },
{ platform: "linux", hostArch: "x64", arch: 3, reason: "unexecutable target linux/arm64" },
{ platform: "linux", hostArch: "arm64", arch: 1, reason: "unexecutable target linux/x64" },
Expand Down
13 changes: 8 additions & 5 deletions scripts/prepare-server-compile-cache.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ const os = require("node:os");

// afterPack runs before signing and installer creation, against the final ASAR layout.
module.exports = async ({ appOutDir, electronPlatformName, arch, packager }) => {
if (!["darwin", "win32", "linux"].includes(electronPlatformName)) {
// The optional cache is populated at runtime. Shipping its entries in the
// Windows installer can exceed the packaged payload file-count limit.
if (electronPlatformName === "win32") {
console.log("[server-compile-cache] Skipping Windows installer cache");
return;
}
if (!["darwin", "linux"].includes(electronPlatformName)) {
console.log(`[server-compile-cache] Skipping unsupported target ${electronPlatformName}`);
return;
}
Expand Down Expand Up @@ -38,10 +44,7 @@ module.exports = async ({ appOutDir, electronPlatformName, arch, packager }) =>
const executable =
electronPlatformName === "darwin"
? path.join(appOutDir, `${product}.app`, "Contents", "MacOS", product)
: path.join(
appOutDir,
electronPlatformName === "win32" ? `${product}.exe` : packager.executableName,
);
: path.join(appOutDir, packager.executableName);
const helper = path.join(
resources,
"app.asar",
Expand Down
Loading