diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12bdd19c49..288f03da2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/dsh-plugin-desktop/scripts/prepare-workdsh-runtime.mjs b/dsh-plugin-desktop/scripts/prepare-workdsh-runtime.mjs index c21fce4764..af4e023663 100644 --- a/dsh-plugin-desktop/scripts/prepare-workdsh-runtime.mjs +++ b/dsh-plugin-desktop/scripts/prepare-workdsh-runtime.mjs @@ -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 })