fix(desktop): share website destination and clarify manual recovery
This commit is contained in:
1 parent
8caf3d7838
commit
70bfd4d516
15 files changed
+59
-22
No files matched your search
@@ -24,8 +24,8 @@
|
||||
en: 3c3e3a09573c4386
|
||||
zh: c851ae6a94f2284a
|
||||
/desktop-publication/fixed-installer-downloads:
|
||||
en: ce8296f8f1ee881e
|
||||
zh: 749ab63bd6ed4248
|
||||
en: e01c63fe6d854df1
|
||||
zh: 3c1e8eeefb8f1d24
|
||||
/desktop-publication/upload-credentials:
|
||||
en: 47442fb912fa4d5d
|
||||
zh: a21a0d67cd01724b
|
||||
|
||||
@@ -73,7 +73,7 @@ Fixed installer downloads use `pnpm run upload:latest:mac:arm64`, `pnpm run uplo
|
||||
|
||||
Production fixed downloads require `DOWNLOAD_PROD_EO_ZONE_ID` in the target dotenv and `teo:CreatePurgeTask` permission for that zone on the existing `DOWNLOAD_PROD_COS_SECRET_ID` / `DOWNLOAD_PROD_COS_SECRET_KEY` identity. The release operator must confirm that permission before use; no additional CI Secret is required. Required settings are resolved before uploading. The submission has a 30-second request timeout and is never retried automatically.
|
||||
|
||||
The command reports submission acceptance, not completed cache invalidation. EO results go to the console without separate purge record files; the existing upload audit records only COS writes. A rejected or unconfirmed submission exits unsuccessfully; the uploaded installer stays published. Check EO task history before submitting again after a connection loss or missing response. To submit a purge without uploading, use `pnpm run purge:latest <target>` with production settings and credentials; no local installer is needed. DPAPI users reuse the original credential launcher and add `-PurgeOnly` to their `-Upload -Latest` invocation. Serialize uploads and cache-only submissions per target. The CI publisher does not publish fixed downloads or run this refresh.
|
||||
The command reports submission acceptance, not completed cache invalidation. EO results go to the console without separate purge record files; the existing upload audit records only COS writes. A rejected or unconfirmed submission exits unsuccessfully; the uploaded installer stays published. Check EO task history before submitting again after a connection loss or missing response. To submit a purge without uploading, use `pnpm run purge:latest <target>` with production settings and credentials; no local installer is needed. DPAPI users reuse the original credential launcher and add `-PurgeOnly` to their `-Upload -Latest` invocation. Serialize uploads and cache-only submissions per target. The [CI publication workflow](ci/README.md#recovery-and-records) has separate website upload and observed-purge jobs.
|
||||
|
||||
<a id="credentials"></a>
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ Windows NSIS 上传要求安装包旁存在生成的非空 `.exe.blockmap`。blo
|
||||
|
||||
生产固定下载要求在目标 dotenv 中配置 `DOWNLOAD_PROD_EO_ZONE_ID`,且既有 `DOWNLOAD_PROD_COS_SECRET_ID` / `DOWNLOAD_PROD_COS_SECRET_KEY` 身份具备对应站点的 `teo:CreatePurgeTask` 权限。发布操作人员须在使用前确认该权限;无需新增 CI Secret。上传前解析必需配置。提交请求超时为 30 秒,不自动重试。
|
||||
|
||||
命令报告提交已接受,不代表缓存清除已完成。EO 结果输出到控制台,不另建刷新记录文件;既有上传审计仅记录 COS 写入。提交被拒绝或未确认时,命令以失败状态退出,已上传安装包保持发布。连接中断或未收到响应时,先检查 EO 任务历史再重新提交。使用 `pnpm run purge:latest <target>` 可只提交刷新,无需上传;需要生产配置和凭据,无需本地安装包。DPAPI 用户复用原凭据启动器,在 `-Upload -Latest` 命令上添加 `-PurgeOnly`。按目标串行执行上传和单独刷新。CI 发布器不发布固定下载,也不执行此刷新。
|
||||
命令报告提交已接受,不代表缓存清除已完成。EO 结果输出到控制台,不另建刷新记录文件;既有上传审计仅记录 COS 写入。提交被拒绝或未确认时,命令以失败状态退出,已上传安装包保持发布。连接中断或未收到响应时,先检查 EO 任务历史再重新提交。使用 `pnpm run purge:latest <target>` 可只提交刷新,无需上传;需要生产配置和凭据,无需本地安装包。DPAPI 用户复用原凭据启动器,在 `-Upload -Latest` 命令上添加 `-PurgeOnly`。按目标串行执行上传和单独刷新。[CI 发布工作流](ci/README.zh.md#recovery-and-records)使用独立的官网上传和刷新观察 job。
|
||||
|
||||
<a id="credentials"></a>
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
en: be3cf37739f7f9b3
|
||||
zh: 33b7c8ca3b547c5e
|
||||
/desktop-ci-publication/recovery-and-records:
|
||||
en: 32ba51ae83843910
|
||||
zh: a956ef14d7bd22f0
|
||||
en: 23a9a6c8e43ca353
|
||||
zh: 1a4942c9bed96c7a
|
||||
/desktop-ci-publication/restore-a-channel:
|
||||
en: d82e2ccf70cce397
|
||||
zh: d93dcb77cc4b463e
|
||||
|
||||
@@ -86,7 +86,7 @@ Production COS publication defaults to **同时上传官网安装包并刷新缓
|
||||
|
||||
Set the repository variable `DOWNLOAD_PROD_EO_ZONE_ID` to the production EdgeOne zone. The production COS credential pair also needs `teo:CreatePurgeTask` and `teo:DescribePurgeTasks`. Website uploads serialize by bucket/target in Actions and by bucket/object on the original machine. Cache observation runs separately. Version publication, website upload and cache refresh each use the production approval Environment; later jobs and reruns may require another approval. GitHub concurrency retains at most one pending job per group, so a newer pending job can cancel an older pending job; inspect canceled jobs before rerunning them.
|
||||
|
||||
Website state lives in `upload-records/website-<publication run ID>-<target>/state.json`, beside the retained releases root. macOS and Windows use the same record format on separate local disks. A completed upload is not repeated on a job rerun; ambiguous uploads reconcile remote bytes first. Rerun only the purge job to inspect its saved task. A manually rerun purge may submit once after confirming the previous task failed. A lost submission response queries matching history instead of resubmitting. An unknown result with a task ID means submission was confirmed; without an ID it may never have been submitted. Inspect EdgeOne history before manual recovery, and a fresh publication run is one recovery option. Operators with the target production dotenv and credentials may instead run `node --import tsx apps/desktop/scripts/upload-target.ts <target> --latest --purge-only` on the configured machine. This submits only a fixed-URL purge: it does not observe completion or update this Actions run’s journal. Inspect the returned task in EdgeOne before considering recovery complete.
|
||||
Website state lives in `upload-records/website-<publication run ID>-<target>/state.json`, beside the retained releases root. macOS and Windows use the same record format on separate local disks. A completed upload is not repeated on a job rerun; ambiguous uploads reconcile remote bytes first. Rerun only the purge job to inspect its saved task. A manually rerun purge may submit once after confirming the previous task failed. A lost submission response queries matching history instead of resubmitting. An unknown result with a task ID means submission was confirmed; without an ID it may never have been submitted. Inspect EdgeOne history before manual recovery, and a fresh publication run is one recovery option. Operators may instead use the documented [fixed-download purge command](../README.md#fixed-downloads); Windows operators use the existing DPAPI credential launcher described there. This submits only a fixed-URL purge: it does not observe completion or update this Actions run’s journal. Inspect the returned task in EdgeOne before considering recovery complete.
|
||||
|
||||
Purge observation waits up to five minutes at ten-second intervals, with one additional query after an unknown result or observation deadline. Confirmed failed, timeout or canceled tasks fail the job. An unresolved result exits successfully with an Actions warning and a prominent summary; its durable state remains unknown, not completed. Diagnostic artifact archival is best effort; local records remain the recovery source. Simulated-provider tests cover these paths; release operators must verify production COS/EdgeOne permissions, job-id filtering, time-range queries, task type and timestamp formats, cross-attempt Actions recovery, and actual CDN behavior before relying on recovery in production.
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ Environment 审批限制此工作流,不限制同一机器账户运行的任
|
||||
|
||||
将仓库变量 `DOWNLOAD_PROD_EO_ZONE_ID` 配置为生产 EdgeOne 站点。生产 COS 凭据还需要 `teo:CreatePurgeTask` 和 `teo:DescribePurgeTasks` 权限。官网上传在 Actions 中按 bucket/平台互斥,在原机器上按 bucket/对象互斥;缓存观察单独运行。版本发布、官网上传和缓存刷新分别使用生产审批 Environment,后续 job 和重跑可能需要再次审批。GitHub 每个并发组最多保留一个排队 job,新排队 job 可能取消旧排队 job;重跑前应检查取消记录。
|
||||
|
||||
官网状态保存在 releases 根目录同级的 `upload-records/website-<发布 run ID>-<target>/state.json`。macOS 和 Windows 在各自本地磁盘使用相同记录格式。job 重跑不重复已确认完成的上传;结果未知的上传先核对远端字节。仅重跑刷新 job 即可查询已保存任务;人工重跑确认旧任务失败后可提交一次。提交响应丢失时查询匹配的历史记录,不重新提交。unknown 带任务 ID 表示提交已确认;没有 ID 则可能从未提交。人工恢复前应检查 EdgeOne 历史,重新发起发布运行是恢复方式之一。已配置目标 production dotenv 和凭据的操作者也可在配置机器上执行 `node --import tsx apps/desktop/scripts/upload-target.ts <target> --latest --purge-only`,只提交固定 URL 刷新,不观察完成状态,也不更新本次 Actions 运行的 journal。确认恢复完成前应在 EdgeOne 检查返回的任务。
|
||||
官网状态保存在 releases 根目录同级的 `upload-records/website-<发布 run ID>-<target>/state.json`。macOS 和 Windows 在各自本地磁盘使用相同记录格式。job 重跑不重复已确认完成的上传;结果未知的上传先核对远端字节。仅重跑刷新 job 即可查询已保存任务;人工重跑确认旧任务失败后可提交一次。提交响应丢失时查询匹配的历史记录,不重新提交。unknown 带任务 ID 表示提交已确认;没有 ID 则可能从未提交。人工恢复前应检查 EdgeOne 历史,重新发起发布运行是恢复方式之一。操作者也可使用已有的[固定下载刷新命令](../README.zh.md#fixed-downloads);Windows 操作者使用该处说明的 DPAPI 凭据启动器。该命令只提交固定 URL 刷新,不观察完成状态,也不更新本次 Actions 运行的 journal。确认恢复完成前应在 EdgeOne 检查返回的任务。
|
||||
|
||||
刷新观察每十秒查询一次,最长五分钟;结果未知或观察超时后额外查询一次。明确的 failed、timeout、canceled 结果使 job 失败。仍无法确认时成功退出,并输出 Actions warning 和醒目摘要;持久化状态保持 unknown,不标为完成。诊断 artifact 尽力归档,本地记录仍是恢复依据。模拟服务测试覆盖这些路径;发布操作者必须在生产依赖恢复能力前验证 COS/EdgeOne 权限、job-id 筛选、时间范围查询、任务类型和时间戳格式、Actions 跨 attempt 恢复及实际 CDN 行为。
|
||||
|
||||
|
||||
@@ -14,6 +14,13 @@ export type DesktopAutoUpdateTarget = 'mac-arm64' | 'mac-x64' | 'win-x64'
|
||||
*/
|
||||
export function desktopLatestInstallerFilename(target: DesktopAutoUpdateTarget): string
|
||||
|
||||
/**
|
||||
* Resolve the production website installer URL shared by approval, upload and purge.
|
||||
* @param target Supported Desktop target.
|
||||
* @returns Fixed production download URL.
|
||||
*/
|
||||
export function desktopWebsiteInstallerUrl(target: DesktopAutoUpdateTarget): string
|
||||
|
||||
/** Public updater URL and object prefixes for one release target. */
|
||||
export interface DesktopAutoUpdateConfig {
|
||||
readonly environment: DesktopAutoUpdateEnvironment
|
||||
|
||||
@@ -46,6 +46,15 @@ export function desktopLatestInstallerFilename(target) {
|
||||
return `dsh-latest-${windows ? 'windows' : 'macos'}-${target === 'mac-arm64' ? 'arm64' : 'x64'}.${windows ? 'exe' : 'dmg'}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the production website installer URL shared by approval, upload and purge.
|
||||
* @param {'mac-arm64' | 'mac-x64' | 'win-x64'} target Supported Desktop target.
|
||||
* @returns {string} Fixed production download URL.
|
||||
*/
|
||||
export function desktopWebsiteInstallerUrl(target) {
|
||||
return `${UPDATE_ENVIRONMENTS.production.fixedOrigin}/desktop/${desktopLatestInstallerFilename(target)}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the update deployment, defaulting local release work to test.
|
||||
* @param {NodeJS.ProcessEnv} env - Packaging or upload environment.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** Render the verified publication plan for GitHub's native deployment reviewers. */
|
||||
import { createHash } from 'node:crypto'
|
||||
import { createReadStream } from 'node:fs'
|
||||
import { desktopLatestInstallerFilename } from './desktop-auto-update-environment.mjs'
|
||||
import { desktopWebsiteInstallerUrl } from './desktop-auto-update-environment.mjs'
|
||||
import type { DesktopRetainedSource } from './desktop-release-store.ts'
|
||||
import type { DesktopUploadPlan } from './desktop-upload-plan.ts'
|
||||
|
||||
@@ -55,7 +55,7 @@ export async function desktopPublicationSummary(
|
||||
row('打包来源', `${link(runUrl, `查看打包运行 #${source.runId} · 第 ${source.attempt} 次尝试`)}<br>源码:${code(`${source.sourceRef} @ ${source.commit}`)}<br>打包机器:${code(source.runnerName)}`),
|
||||
row('签名与公证', plan.target === 'win-x64' ? 'EXE 签名校验通过' : 'DMG 校验通过<br>ZIP 内应用校验通过'),
|
||||
...(uploadWebsite && plan.environment === 'production' ? [row('官网固定安装包',
|
||||
`${link(`https://download.deepseek.com/desktop/${desktopLatestInstallerFilename(plan.target)}`)}<br>替换为版本 ${code(plan.version)};已有安装包会被替换,无防降级保护;随后刷新缓存。`)] : []),
|
||||
`${link(desktopWebsiteInstallerUrl(plan.target))}<br>替换为版本 ${code(plan.version)};已有安装包会被替换,无防降级保护;官网上传与刷新在后续 job 中执行,可能需另行审批。`)] : []),
|
||||
row('Git tag', tag), '', '### 批准后将执行', '',
|
||||
'1. 重新校验产物与发布目标;若与审批摘要不一致则停止。',
|
||||
'2. 上传缺少的文件,跳过内容一致的已有文件;发现内容冲突则停止。',
|
||||
|
||||
@@ -4,7 +4,7 @@ import { open, lstat, type FileHandle } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
import type { DesktopRetainedManifest } from './desktop-release-store.ts'
|
||||
import type { DesktopPublishRoute } from './desktop-publish-route.ts'
|
||||
import { desktopLatestInstallerFilename } from './desktop-auto-update-environment.mjs'
|
||||
import { desktopLatestInstallerFilename, desktopWebsiteInstallerUrl } from './desktop-auto-update-environment.mjs'
|
||||
import { createDesktopCos, DESKTOP_COS_REGION, type DesktopCosCredentials } from './desktop-cos.ts'
|
||||
import { cosOperation } from './cos-operation.ts'
|
||||
import type { DesktopObjectDigest, DesktopPublishTransport } from './desktop-publish.ts'
|
||||
@@ -61,7 +61,7 @@ export async function prepareWebsiteInstaller(directory: string, manifest: Deskt
|
||||
const key = `desktop/${desktopLatestInstallerFilename(route.target)}`
|
||||
return { handle, digest, md5: md5.digest('base64'), plan: {
|
||||
environment: 'production', target: route.target, version: source.version, commit: source.commit, dirty: false,
|
||||
bucket, publicUrl: `https://download.deepseek.com/${key}`,
|
||||
bucket, publicUrl: desktopWebsiteInstallerUrl(route.target),
|
||||
secretIdEnvName: 'DOWNLOAD_PROD_COS_SECRET_ID', secretKeyEnvName: 'DOWNLOAD_PROD_COS_SECRET_KEY',
|
||||
artifacts: [{ path, filename: file.name, key, channelMetadata: false,
|
||||
contentType: windows ? 'application/vnd.microsoft.portable-executable' : 'application/x-apple-diskimage' }],
|
||||
|
||||
@@ -86,8 +86,8 @@ export async function publishWebsiteCi(mode: 'upload' | 'purge', env: NodeJS.Pro
|
||||
return
|
||||
}
|
||||
if (state.upload !== 'uploaded') throw new Error('website publication: upload completion is not confirmed; recover the upload job first')
|
||||
const { desktopLatestInstallerFilename } = await import('./desktop-auto-update-environment.mjs')
|
||||
const publicUrl = `${config.origin}/desktop/${desktopLatestInstallerFilename(route.target)}`
|
||||
const { desktopWebsiteInstallerUrl } = await import('./desktop-auto-update-environment.mjs')
|
||||
const publicUrl = desktopWebsiteInstallerUrl(route.target)
|
||||
const { teo } = await import('tencentcloud-sdk-nodejs-teo')
|
||||
const client = new teo.v20220901.Client({ credential: credentials, region: '',
|
||||
profile: { httpProfile: { endpoint: 'teo.tencentcloudapi.com', reqTimeout: 30 } } })
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
desktopBuildRecordFilename,
|
||||
desktopWebsiteInstallerUrl,
|
||||
desktopUpdateMetadataFilename,
|
||||
resolveDesktopAutoUpdateConfig,
|
||||
resolveDesktopAutoUpdateEnvironment,
|
||||
@@ -119,3 +120,11 @@ describe('desktop auto-update environment', () => {
|
||||
expect(() => desktopUpdateMetadataFilename('1.2.3', 'linux')).toThrow(/unsupported metadata platform/u)
|
||||
})
|
||||
})
|
||||
|
||||
it.each([
|
||||
['mac-arm64', 'dsh-latest-macos-arm64.dmg'],
|
||||
['mac-x64', 'dsh-latest-macos-x64.dmg'],
|
||||
['win-x64', 'dsh-latest-windows-x64.exe'],
|
||||
] as const)('uses the production origin for website target %s', (target, filename) => {
|
||||
expect(desktopWebsiteInstallerUrl(target)).toBe(`https://download.deepseek.com/desktop/${filename}`)
|
||||
})
|
||||
@@ -13,7 +13,7 @@
|
||||
| 升级 YAML | <a href="https://download.example.com/dsh-desk/feeds/win-x64/latest.yml">https://download.example.com/dsh-desk/feeds/win-x64/latest.yml</a><br>本次发布将更新此文件;审批前可能不存在或仍指向旧版本。 |
|
||||
| 打包来源 | <a href="https://github.com/owner/repo/actions/runs/20/attempts/3">查看打包运行 #20 · 第 3 次尝试</a><br>源码:<code>dsh-v1.0.0 @ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</code><br>打包机器:<code>windows-publisher</code> |
|
||||
| 签名与公证 | EXE 签名校验通过 |
|
||||
| 官网固定安装包 | <a href="https://download.deepseek.com/desktop/dsh-latest-windows-x64.exe">https://download.deepseek.com/desktop/dsh-latest-windows-x64.exe</a><br>替换为版本 <code>1.0.0</code>;已有安装包会被替换,无防降级保护;随后刷新缓存。 |
|
||||
| 官网固定安装包 | <a href="https://download.deepseek.com/desktop/dsh-latest-windows-x64.exe">https://download.deepseek.com/desktop/dsh-latest-windows-x64.exe</a><br>替换为版本 <code>1.0.0</code>;已有安装包会被替换,无防降级保护;官网上传与刷新在后续 job 中执行,可能需另行审批。 |
|
||||
| Git tag | <code>desktop-v1.0.0</code> |
|
||||
|
||||
### 批准后将执行
|
||||
|
||||
@@ -4,14 +4,14 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, expect, it, vi } from 'vitest'
|
||||
import * as desktopCos from '../scripts/desktop-cos.ts'
|
||||
import { answer, startCosLoopback } from './cos-loopback.ts'
|
||||
import { answer, cosError, startCosLoopback } from './cos-loopback.ts'
|
||||
import { teo } from 'tencentcloud-sdk-nodejs-teo'
|
||||
import { publishWebsiteCi, websiteApproval } from '../scripts/publish-website-ci.ts'
|
||||
|
||||
vi.mock('node:timers/promises', () => ({ setTimeout: async () => {} }))
|
||||
afterEach(() => vi.restoreAllMocks())
|
||||
|
||||
it.each(['accepted', 'unconfirmed', 'upload', 'uploaded', 'approval'] as const)('preserves publication recovery for %s', async (scenario) => {
|
||||
it.each(['accepted', 'unconfirmed', 'upload', 'put', 'uploaded', 'approval'] as const)('preserves publication recovery for %s', async (scenario) => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'website-ci-'))
|
||||
try {
|
||||
const config = join(root, 'packaging')
|
||||
@@ -37,10 +37,20 @@ it.each(['accepted', 'unconfirmed', 'upload', 'uploaded', 'approval'] as const)(
|
||||
const env = { RUNNER_NAME: 'mini', GITHUB_REPOSITORY: 'owner/repo', GITHUB_RUN_ID: '99',
|
||||
GITHUB_RUN_ATTEMPT: '1', DSH_PACKAGING_CONFIG_DIR: config, DESKTOP_PUBLISH_ROUTE: JSON.stringify(route),
|
||||
DESKTOP_WEBSITE_APPROVAL: approval, DOWNLOAD_PROD_EO_ZONE_ID: 'zone-fixture', GITHUB_OUTPUT: join(root, 'output') }
|
||||
if (scenario === 'upload' || scenario === 'uploaded' || scenario === 'approval') {
|
||||
if (scenario === 'upload' || scenario === 'put' || scenario === 'uploaded' || scenario === 'approval') {
|
||||
await writeFile(join(root, 'releases', '12', '1', manifest.files[0]!.name), 'x')
|
||||
if (scenario === 'upload') await rm(join(records, 'state.json'))
|
||||
const server = await startCosLoopback((_request, response) => { answer(response, 200, 'x') })
|
||||
if (scenario === 'upload' || scenario === 'put') await rm(join(records, 'state.json'))
|
||||
let stored = scenario !== 'put'
|
||||
const server = await startCosLoopback((request, response) => {
|
||||
if (request.method === 'PUT') {
|
||||
expect(request.body.toString()).toBe('x')
|
||||
stored = true
|
||||
answer(response)
|
||||
return
|
||||
}
|
||||
if (!stored) answer(response, 404, cosError('NoSuchKey'))
|
||||
else answer(response, 200, 'x')
|
||||
})
|
||||
const original = desktopCos.createDesktopCos
|
||||
vi.spyOn(desktopCos, 'createDesktopCos').mockImplementation((credentials) => {
|
||||
const client = original(credentials)
|
||||
@@ -55,9 +65,9 @@ it.each(['accepted', 'unconfirmed', 'upload', 'uploaded', 'approval'] as const)(
|
||||
const output = vi.spyOn(process.stdout, 'write').mockReturnValue(true)
|
||||
await publishWebsiteCi('upload', env)
|
||||
expect(output.mock.calls.map(call => String(call[0])).join('')).toContain(scenario === 'upload'
|
||||
? 'identical remote bytes confirmed; skipped' : 'previous upload confirmed by journal; skipped')
|
||||
? 'identical remote bytes confirmed; skipped' : scenario === 'put' ? 'Website installer uploaded:' : 'previous upload confirmed by journal; skipped')
|
||||
if (scenario === 'upload') expect(server.requests[0]!.path).toBe('/desktop/dsh-latest-macos-arm64.dmg')
|
||||
expect(server.requests.map(request => request.method)).toEqual(scenario === 'upload' ? ['GET'] : [])
|
||||
expect(server.requests.map(request => request.method)).toEqual(scenario === 'upload' ? ['GET'] : scenario === 'put' ? ['GET', 'PUT', 'GET'] : [])
|
||||
expect(JSON.parse(await readFile(join(records, 'state.json'), 'utf8'))).toMatchObject({ approval, upload: 'uploaded' })
|
||||
expect(await readFile(env.GITHUB_OUTPUT, 'utf8')).toContain(`record=${records}`)
|
||||
}
|
||||
|
||||
@@ -82,6 +82,8 @@ it('rejects non-master dispatch before scheduling a self-hosted job', () => {
|
||||
|
||||
it('defaults to production website upload and separates cache-only recovery', () => {
|
||||
expect(workflow.on.workflow_dispatch).toMatchObject({ inputs: { upload_website: { type: 'boolean', default: true } } })
|
||||
expect(workflow.jobs.prepare!.env?.DESKTOP_UPLOAD_WEBSITE).toBe('${{ inputs.upload_website }}')
|
||||
expect(workflow.jobs.prepare!.env?.DOWNLOAD_PROD_EO_ZONE_ID).toBe('${{ vars.DOWNLOAD_PROD_EO_ZONE_ID }}')
|
||||
const upload = workflow.jobs['upload-website-installer']!
|
||||
const purge = workflow.jobs['purge-website-installer']!
|
||||
expect(upload.if).toContain("inputs.upload_website && needs.prepare.outputs.preset == 'production'")
|
||||
|
||||
Reference in new issue
Block a user