ci: validate Desktop against same-commit Web release candidate

This commit is contained in:
techflag
2026-09-26 19:52:59 +08:00
parent beb5849f53
commit 2f30140796
2 changed files with 29 additions and 3 deletions
+17
View File
@@ -160,8 +160,17 @@ jobs:
- run: yarn install --immutable
- run: yarn upstream:install
- run: yarn workspace dsh-plugin-desktop check:win-package
- name: Pack this commit's Web Profile for package validation
if: github.ref_type != 'tag'
working-directory: workdsh-web
run: |
corepack pnpm install --frozen-lockfile
corepack pnpm build
corepack pnpm release:project:pack
- name: Prepare WorkDSH release profile
timeout-minutes: 15
env:
WORKDSH_USE_LOCAL_RELEASE: ${{ github.ref_type != 'tag' && '1' || '0' }}
run: yarn workspace dsh-plugin-desktop prepare:workdsh-runtime
- name: Prepare official Python and Node runtime
timeout-minutes: 15
@@ -223,10 +232,18 @@ jobs:
- run: yarn install --immutable
- run: yarn upstream:install
- run: yarn workspace dsh-plugin-desktop check:mac-package
- name: Pack this commit's Web Profile for package validation
if: github.ref_type != 'tag'
working-directory: workdsh-web
run: |
corepack pnpm install --frozen-lockfile
corepack pnpm build
corepack pnpm release:project:pack
- name: Prepare WorkDSH release profile
timeout-minutes: 15
env:
WORKDSH_MAC_ARCH: ${{ matrix.arch }}
WORKDSH_USE_LOCAL_RELEASE: ${{ github.ref_type != 'tag' && '1' || '0' }}
run: yarn workspace dsh-plugin-desktop prepare:workdsh-runtime
- name: Prepare official Python and Node runtime
timeout-minutes: 15
@@ -59,11 +59,19 @@ async function installReleasedProfile(output) {
const releaseDir = join(desktopRoot, 'build', `.workdsh-release-${WORKDSH_VERSION}`)
mkdirSync(releaseDir, { recursive: true })
const base = `https://github.com/techflag/workdsh/releases/download/v${WORKDSH_VERSION}`
const localReleaseDir = process.env.WORKDSH_USE_LOCAL_RELEASE === '1'
? resolve(desktopRoot, '..', 'workdsh-web', '.artifacts', `project-v${WORKDSH_VERSION}`)
: undefined
if (localReleaseDir && !existsSync(join(localReleaseDir, 'release-manifest.json'))) {
throw new Error(`Local WorkDSH release candidate is missing: ${localReleaseDir}`)
}
const manifestPath = join(releaseDir, 'release-manifest.json')
await download(`${base}/release-manifest.json`, manifestPath)
if (localReleaseDir) cpSync(join(localReleaseDir, 'release-manifest.json'), manifestPath)
else await download(`${base}/release-manifest.json`, manifestPath)
const rawInstallerPath = join(releaseDir, 'install-workdsh.original.mjs')
const installerPath = join(releaseDir, 'install-workdsh.mjs')
await download(`${base}/install-workdsh.mjs`, rawInstallerPath)
if (localReleaseDir) cpSync(join(localReleaseDir, 'install-workdsh.mjs'), rawInstallerPath)
else await download(`${base}/install-workdsh.mjs`, rawInstallerPath)
let installer = readFileSync(rawInstallerPath, 'utf8')
installer = replaceRequired(installer,
'profilePackage.packageManager = manifest.packageManager;',
@@ -129,7 +137,8 @@ async function installReleasedProfile(output) {
}
writeFileSync(installerPath, installer)
for (const item of manifest.packages) {
await download(`${base}/${item.filename}`, join(releaseDir, item.filename))
if (localReleaseDir) cpSync(join(localReleaseDir, item.filename), join(releaseDir, item.filename))
else await download(`${base}/${item.filename}`, join(releaseDir, item.filename))
}
mkdirSync(output, { recursive: true })