diff --git a/.github/workflows/electron-release.yml b/.github/workflows/electron-release.yml index b225342a4e..b86cd50f69 100644 --- a/.github/workflows/electron-release.yml +++ b/.github/workflows/electron-release.yml @@ -201,6 +201,12 @@ jobs: [ -f "$file" ] && cp "$file" "../../release-assets/OmniRoute.exe" && break done fi + # electron-updater manifests (latest.yml / latest-mac.yml / latest-linux.yml) + # must be published alongside the installers, or autoUpdater fails with + # "Cannot find latest.yml in the latest release artifacts" (#6766). + for file in latest*.yml; do + [ -f "$file" ] && cp "$file" ../../release-assets/ + done - name: Upload artifacts uses: actions/upload-artifact@v7 @@ -263,6 +269,7 @@ jobs: release-assets/*.AppImage release-assets/*.deb release-assets/*.blockmap + release-assets/*.yml release-assets/*.source.tar.gz release-assets/*.source.zip env: diff --git a/changelog.d/fixes/6766-6766-auto-update.md b/changelog.d/fixes/6766-6766-auto-update.md new file mode 100644 index 0000000000..ec08f4a65b --- /dev/null +++ b/changelog.d/fixes/6766-6766-auto-update.md @@ -0,0 +1 @@ +- fix(ci): publish electron-updater `latest*.yml` manifests in electron release assets so auto-update can find them ([#6766](https://github.com/diegosouzapw/OmniRoute/issues/6766)) diff --git a/stryker.conf.json b/stryker.conf.json index f1c8ba74c8..5a71a440e1 100644 --- a/stryker.conf.json +++ b/stryker.conf.json @@ -106,6 +106,7 @@ "tests/unit/claude-passthrough-stream-boolean.test.ts", "tests/unit/claude-passthrough-thinking-2454.test.ts", "tests/unit/cli-simulate.test.ts", + "tests/unit/cliproxyapi-model-mapping-dispatch.test.ts", "tests/unit/cline-response-envelope.test.ts", "tests/unit/cliproxyapi-model-mapping-dispatch.test.ts", "tests/unit/clinepass-provider.test.ts", diff --git a/tests/unit/build/electron-release-latest-yml.repro.test.ts b/tests/unit/build/electron-release-latest-yml.repro.test.ts new file mode 100644 index 0000000000..2aca6cbd02 --- /dev/null +++ b/tests/unit/build/electron-release-latest-yml.repro.test.ts @@ -0,0 +1,78 @@ +// Repro probe for issue #6766: "Auto-update failed: Cannot find latest.yml in the +// latest release artifacts". +// +// electron-updater (used by electron/main.js via autoUpdater) fetches +// latest.yml / latest-mac.yml / latest-linux.yml from the GitHub Release assets +// to discover + verify the newest version. electron-builder generates those +// files alongside the installers in electron/dist-electron/, but the release +// workflow's "Collect installers" step only copies platform installer +// extensions (*.exe, *.dmg, *.AppImage, *.deb) into release-assets/ — never +// the *.yml manifests — so they never reach the GitHub Release, and +// electron-updater fails with exactly the reported error. +// +// This test statically inspects .github/workflows/electron-release.yml and +// proves the "Collect installers" step stages the yml manifests, and +// that the "Create Release" files: list references them too. + +import test from "node:test"; +import assert from "node:assert/strict"; +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const WORKFLOW_PATH = path.resolve( + __dirname, + "../../../.github/workflows/electron-release.yml" +); + +function readWorkflow(): string { + return fs.readFileSync(WORKFLOW_PATH, "utf8"); +} + +function extractStep(yaml: string, stepName: string): string { + const stepHeaderRe = new RegExp(`- name: ${stepName}\\n([\\s\\S]*?)(?=\\n\\s{6}- name:|\\n [a-zA-Z_-]+:\\n)`); + const m = yaml.match(stepHeaderRe); + assert.ok(m, `could not locate step "${stepName}" in ${WORKFLOW_PATH}`); + return m![1]; +} + +test("electron-release.yml: 'Collect installers' step stages latest*.yml manifests for electron-updater", () => { + const yaml = readWorkflow(); + const collectStep = extractStep(yaml, "Collect installers"); + + // electron-builder writes latest.yml (win), latest-mac.yml, latest-linux.yml + // next to the installers in electron/dist-electron/. Without staging them + // into release-assets/, the GitHub Release never gets latest.yml and + // electron-updater's autoUpdater fails with: + // "Cannot find latest.yml in the latest release artifacts" + const stagesYmlManifests = + /\*\.yml/.test(collectStep) || /latest.*\.yml/.test(collectStep); + + assert.ok( + stagesYmlManifests, + "BUG REPRODUCED: 'Collect installers' step does not copy *.yml (latest.yml / " + + "latest-mac.yml / latest-linux.yml) from electron/dist-electron/ into " + + "release-assets/, so electron-updater cannot find latest.yml in the " + + "published GitHub Release (issue #6766).\n\nActual step body:\n" + + collectStep + ); +}); + +test("electron-release.yml: 'Create Release' files: list publishes the *.yml update manifests", () => { + const yaml = readWorkflow(); + const createReleaseIdx = yaml.indexOf("name: Create Release"); + assert.ok(createReleaseIdx !== -1, "could not locate 'Create Release' step"); + const filesBlockIdx = yaml.indexOf("files: |", createReleaseIdx); + assert.ok(filesBlockIdx !== -1, "could not locate files: block in 'Create Release' step"); + const nextStepOrEnvIdx = yaml.indexOf("\n env:", filesBlockIdx); + const filesBlock = yaml.slice(filesBlockIdx, nextStepOrEnvIdx === -1 ? undefined : nextStepOrEnvIdx); + + assert.ok( + /release-assets\/\*\.yml/.test(filesBlock), + "BUG REPRODUCED: 'Create Release' files: glob list does not include " + + "release-assets/*.yml, so even if the manifests were staged they would " + + "not be attached to the GitHub Release (issue #6766).\n\nActual files: block:\n" + + filesBlock + ); +}); diff --git a/tests/unit/provider-models-route-codex.test.ts b/tests/unit/provider-models-route-codex.test.ts index c6b6ba9291..b03b1ee38b 100644 --- a/tests/unit/provider-models-route-codex.test.ts +++ b/tests/unit/provider-models-route-codex.test.ts @@ -109,7 +109,7 @@ test("provider models route discovers live Codex models and preserves static ali display_name: "GPT 5.6 GitHub", visibility: "list", supported_in_api: true, - minimal_client_version: "0.142.0", + minimal_client_version: "0.144.0", context_window: 372000, input_modalities: ["text", "image"], supported_reasoning_levels: [{ effort: "low" }, { effort: "high" }], @@ -190,7 +190,7 @@ test("provider models route uses the GitHub Codex catalog when live discovery fa display_name: "GPT-5.6-Sol", visibility: "list", supported_in_api: true, - minimal_client_version: "0.142.0", + minimal_client_version: "0.144.0", context_window: 372000, }, ],