From 20c946109e87f8d451ce1b604ab1214d5611b198 Mon Sep 17 00:00:00 2001 From: MK Date: Wed, 19 Aug 2026 14:15:33 +0800 Subject: [PATCH 1/2] ci: link preview Windows installers --- .../workflows/publish-preview-register.yml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/publish-preview-register.yml b/.github/workflows/publish-preview-register.yml index c8d33ba820..0042761650 100644 --- a/.github/workflows/publish-preview-register.yml +++ b/.github/workflows/publish-preview-register.yml @@ -77,6 +77,8 @@ jobs: pr-url: ${{ steps.check.outputs.pr_url }} is-fork: ${{ steps.check.outputs.is_fork }} head-repo: ${{ steps.check.outputs.head_repo }} + installer-x64-id: ${{ steps.check.outputs.installer_x64_id }} + installer-arm64-id: ${{ steps.check.outputs.installer_arm64_id }} steps: - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 id: check @@ -189,6 +191,19 @@ jobs: return; } + const installerTargets = { + installer_x64_id: 'vp-setup-x86_64-pc-windows-msvc', + installer_arm64_id: 'vp-setup-aarch64-pc-windows-msvc', + }; + for (const [output, name] of Object.entries(installerTargets)) { + const artifact = artifacts.find((a) => a.name === name && !a.expired); + if (!artifact) { + core.setFailed(`run ${process.env.RUN_ID} has no active ${name} artifact`); + return; + } + core.setOutput(output, String(artifact.id)); + } + const headRepo = pr.head.repo?.full_name ?? '(deleted fork)'; const isFork = headRepo !== `${owner}/${repo}`; core.setOutput('eligible', 'true'); @@ -329,6 +344,9 @@ jobs: IS_FORK: ${{ needs.authorize.outputs.is-fork }} HEAD_REPO: ${{ needs.authorize.outputs.head-repo }} RUN_URL: ${{ github.event.workflow_run.html_url }} + RUN_ID: ${{ github.event.workflow_run.id }} + INSTALLER_X64_ID: ${{ needs.authorize.outputs.installer-x64-id }} + INSTALLER_ARM64_ID: ${{ needs.authorize.outputs.installer-arm64-id }} with: script: | const version = process.env.BRIDGE_VERSION; @@ -337,6 +355,8 @@ jobs: const isFork = process.env.IS_FORK === 'true'; const marker = ''; const bridge = 'https://registry-bridge.viteplus.dev/'; + const artifactUrl = (id) => + `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.RUN_ID}/artifacts/${id}`; // Built as a line array (not a template literal) so the inline // backticks and the fenced json block don't need backslash-escaping. const body = [ @@ -373,6 +393,19 @@ jobs: `$env:VP_PR_VERSION="${pr}"; irm https://vite.plus/ps1 | iex`, '```', '', + '**Or download the standalone Windows installer built from this commit:**', + '', + '| Architecture | Installer |', + '| --- | --- |', + `| x64 | [\`vp-setup-x86_64-pc-windows-msvc.exe\`](${artifactUrl(process.env.INSTALLER_X64_ID)}) |`, + `| Arm64 | [\`vp-setup-aarch64-pc-windows-msvc.exe\`](${artifactUrl(process.env.INSTALLER_ARM64_ID)}) |`, + '', + 'GitHub requires you to sign in and downloads each installer as a ZIP artifact. Extract `vp-setup.exe`, then run it against this preview build:', + '', + '```powershell', + `.\\vp-setup.exe --version "${version}" --registry "${bridge}"`, + '```', + '', `After installing, upgrade the current project's \`vite-plus\` to this test build with:`, '', '```bash', From 3a3cb4ef0b68f71716bb59a9c58608494ea4f33a Mon Sep 17 00:00:00 2001 From: MK Date: Wed, 19 Aug 2026 22:37:47 +0800 Subject: [PATCH 2/2] ci: pin preview installer scripts --- .github/workflows/publish-preview-register.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-preview-register.yml b/.github/workflows/publish-preview-register.yml index 0042761650..066da458ee 100644 --- a/.github/workflows/publish-preview-register.yml +++ b/.github/workflows/publish-preview-register.yml @@ -355,6 +355,8 @@ jobs: const isFork = process.env.IS_FORK === 'true'; const marker = ''; const bridge = 'https://registry-bridge.viteplus.dev/'; + const installerScripts = + `https://raw.githubusercontent.com/${process.env.HEAD_REPO}/${process.env.HEAD_SHA}/packages/cli`; const artifactUrl = (id) => `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.RUN_ID}/artifacts/${id}`; // Built as a line array (not a template literal) so the inline @@ -386,11 +388,11 @@ jobs: '', '```bash', '# macOS / Linux', - `curl -fsSL https://vite.plus | VP_PR_VERSION=${pr} bash`, + `curl -fsSL ${installerScripts}/install.sh | VP_PR_VERSION=${pr} bash`, '```', '```powershell', '# Windows (PowerShell)', - `$env:VP_PR_VERSION="${pr}"; irm https://vite.plus/ps1 | iex`, + `$env:VP_PR_VERSION="${pr}"; irm ${installerScripts}/install.ps1 | iex`, '```', '', '**Or download the standalone Windows installer built from this commit:**',