From 6b33ba21e0575f9cb831445b556187829a7967a0 Mon Sep 17 00:00:00 2001 From: sim Date: Sun, 19 Jul 2026 00:11:34 +0800 Subject: [PATCH] fix(updater): prepare 1.3.15-Beta.2 after repository transfer --- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/workflows/android-apk.yml | 2 +- .github/workflows/release-tauri.yml | 2 +- Casks/openless.rb | 4 +- README.md | 10 ++--- README.zh.md | 10 ++--- USAGE.md | 4 +- openless-all/app/package-lock.json | 4 +- openless-all/app/package.json | 2 +- .../app/scripts/frontend-test-runner.test.mjs | 1 + .../repository-owner-contract.test.mjs | 43 +++++++++++++++++++ .../app/scripts/write-updater-manifest.mjs | 2 +- openless-all/app/src-tauri/Cargo.lock | 2 +- openless-all/app/src-tauri/Cargo.toml | 2 +- .../src-tauri/src/android/updater_logic.rs | 14 +++--- .../app/src-tauri/src/commands/mod.rs | 40 ++++++++--------- .../app/src-tauri/src/commands/settings.rs | 12 +++--- openless-all/app/src-tauri/tauri.conf.json | 6 +-- .../app/src/components/AutoUpdate.tsx | 2 +- .../app/src/components/SettingsModal.tsx | 4 +- .../app/src/pages/settings/AboutSection.tsx | 9 ++-- 21 files changed, 110 insertions(+), 67 deletions(-) create mode 100644 openless-all/app/scripts/repository-owner-contract.test.mjs diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index cf3f4a3de..6870fd71d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true contact_links: - name: OpenLess issue / PR 规范 - url: https://github.com/appergb/openless + url: https://github.com/Open-Less/openless about: 提交前请确认中文正文、upstream 兼容标题、issue-first 和单一职责 PR 规则。 diff --git a/.github/workflows/android-apk.yml b/.github/workflows/android-apk.yml index 8eb820a5b..3ac5a28df 100644 --- a/.github/workflows/android-apk.yml +++ b/.github/workflows/android-apk.yml @@ -330,7 +330,7 @@ jobs: working-directory: openless-all/app env: OPENLESS_UPDATE_APK_DIR: ${{ steps.apk.outputs.out_dir }} - OPENLESS_UPDATE_REPO: appergb/openless + OPENLESS_UPDATE_REPO: Open-Less/openless OPENLESS_UPDATE_MIRROR_BASE_URL: https://fastgit.cc/https://github.com OPENLESS_RELEASE_CHANNEL: ${{ env.OPENLESS_RELEASE_CHANNEL }} OPENLESS_RELEASE_TAG: ${{ github.ref_name }} diff --git a/.github/workflows/release-tauri.yml b/.github/workflows/release-tauri.yml index 462635cd7..06a795549 100644 --- a/.github/workflows/release-tauri.yml +++ b/.github/workflows/release-tauri.yml @@ -499,7 +499,7 @@ jobs: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} OPENLESS_UPDATE_TARGET: ${{ matrix.updater-target }} OPENLESS_UPDATE_ARCH: ${{ matrix.updater-arch }} - OPENLESS_UPDATE_REPO: appergb/openless + OPENLESS_UPDATE_REPO: Open-Less/openless OPENLESS_UPDATE_MIRROR_BASE_URL: https://fastgit.cc/https://github.com # beta 渠道时输出 latest-{tgt}-{arch}-beta.json,stable 沿用旧文件名。 OPENLESS_RELEASE_CHANNEL: ${{ env.OPENLESS_RELEASE_CHANNEL }} diff --git a/Casks/openless.rb b/Casks/openless.rb index af0ce4333..e99e910bf 100644 --- a/Casks/openless.rb +++ b/Casks/openless.rb @@ -5,10 +5,10 @@ sha256 arm: "4bfa85f48714626ec010b92d22a5ab98c834f60b5c7e5f6281e12a11ad90ad9f", intel: "929ad6c047fc8942724b7e1edb5dc0d88affbd2ec4184b2dd3d482c0e06d999f" - url "https://github.com/appergb/openless/releases/download/v#{version}-tauri/OpenLess_#{version}_#{arch}.dmg" + url "https://github.com/Open-Less/openless/releases/download/v#{version}-tauri/OpenLess_#{version}_#{arch}.dmg" name "OpenLess" desc "Menu-bar voice input layer" - homepage "https://github.com/appergb/openless" + homepage "https://github.com/Open-Less/openless" livecheck do url :url diff --git a/README.md b/README.md index d04854a49..de9ad9c76 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@

Website  ·  - Download + Download  ·  English  /  @@ -24,9 +24,9 @@

- Release - License - Stars + Release + License + Stars Discord

@@ -240,7 +240,7 @@ Go to [Releases](../../releases) and download: - If unsure, run `adb shell getprop ro.product.cpu.abi` and pick the matching APK. - **macOS (Homebrew)**: ```bash - brew tap appergb/openless https://github.com/appergb/openless + brew tap Open-Less/openless https://github.com/Open-Less/openless brew install --cask openless xattr -cr /Applications/OpenLess.app diff --git a/README.zh.md b/README.zh.md index 6cc44672e..5c20352b5 100644 --- a/README.zh.md +++ b/README.zh.md @@ -16,7 +16,7 @@

官网  ·  - 下载 + 下载  ·  English  /  @@ -24,9 +24,9 @@

- Release - License - Stars + Release + License + Stars Discord

@@ -240,7 +240,7 @@ OpenLess 只做一件事:**把语音变成可用的书面文字(尤其是 AI 提 - 不确定时执行 `adb shell getprop ro.product.cpu.abi`,下载对应 ABI 的包。 - **macOS(Homebrew)**: ```bash - brew tap appergb/openless https://github.com/appergb/openless + brew tap Open-Less/openless https://github.com/Open-Less/openless brew install --cask openless xattr -cr /Applications/OpenLess.app diff --git a/USAGE.md b/USAGE.md index c3fcc0e5a..d6c4458d4 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,13 +4,13 @@ ### macOS -1. 从 [Releases](https://github.com/appergb/openless/releases/latest) 下载 `OpenLess_<版本>_aarch64.dmg`。 +1. 从 [Releases](https://github.com/Open-Less/openless/releases/latest) 下载 `OpenLess_<版本>_aarch64.dmg`。 2. 打开 dmg,将 OpenLess.app 拖入「应用程序」文件夹。 3. 双击启动。 ### Windows -1. 从 [Releases](https://github.com/appergb/openless/releases/latest) 下载 `OpenLess_<版本>_x64-setup.exe`。 +1. 从 [Releases](https://github.com/Open-Less/openless/releases/latest) 下载 `OpenLess_<版本>_x64-setup.exe`。 2. 运行安装程序,按提示完成安装。 3. 从开始菜单启动 OpenLess。 diff --git a/openless-all/app/package-lock.json b/openless-all/app/package-lock.json index b16ce40cd..9d43a18b2 100644 --- a/openless-all/app/package-lock.json +++ b/openless-all/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "openless-app", - "version": "1.3.15-Beta.1", + "version": "1.3.15-Beta.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openless-app", - "version": "1.3.15-Beta.1", + "version": "1.3.15-Beta.2", "dependencies": { "@base-ui/react": "^1.6.0", "@formkit/auto-animate": "^0.9.0", diff --git a/openless-all/app/package.json b/openless-all/app/package.json index c9e7340d7..144dff099 100644 --- a/openless-all/app/package.json +++ b/openless-all/app/package.json @@ -1,7 +1,7 @@ { "name": "openless-app", "private": true, - "version": "1.3.15-Beta.1", + "version": "1.3.15-Beta.2", "type": "module", "scripts": { "pretest": "npm run build", diff --git a/openless-all/app/scripts/frontend-test-runner.test.mjs b/openless-all/app/scripts/frontend-test-runner.test.mjs index 957957152..c33ef2fa7 100644 --- a/openless-all/app/scripts/frontend-test-runner.test.mjs +++ b/openless-all/app/scripts/frontend-test-runner.test.mjs @@ -10,6 +10,7 @@ for (const expected of [ 'scripts/check-hotkey-injection.mjs', 'scripts/macos-capsule-spaces-contract.test.mjs', 'scripts/macos-speech-usage-description-contract.test.mjs', + 'scripts/repository-owner-contract.test.mjs', 'scripts/windows-ui-config.test.mjs', 'src/lib/hotkeyRecorder.test.ts', 'src/lib/windowHotkeyFallback.test.ts', diff --git a/openless-all/app/scripts/repository-owner-contract.test.mjs b/openless-all/app/scripts/repository-owner-contract.test.mjs new file mode 100644 index 000000000..dfaae3cf4 --- /dev/null +++ b/openless-all/app/scripts/repository-owner-contract.test.mjs @@ -0,0 +1,43 @@ +import assert from 'node:assert/strict'; +import { readFile } from 'node:fs/promises'; +import { join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const repoRoot = fileURLToPath(new URL('../../..', import.meta.url)); +const currentRepo = 'Open-Less/openless'; +const legacyRepo = 'appergb/openless'; + +const repositoryReferences = [ + '.github/ISSUE_TEMPLATE/config.yml', + '.github/workflows/android-apk.yml', + '.github/workflows/release-tauri.yml', + 'Casks/openless.rb', + 'README.md', + 'README.zh.md', + 'USAGE.md', + 'openless-all/app/src-tauri/src/android/updater_logic.rs', + 'openless-all/app/src-tauri/src/commands/mod.rs', + 'openless-all/app/src-tauri/src/commands/settings.rs', + 'openless-all/app/src-tauri/tauri.conf.json', + 'openless-all/app/src/components/AutoUpdate.tsx', + 'openless-all/app/src/components/SettingsModal.tsx', + 'openless-all/app/src/pages/settings/AboutSection.tsx', + 'openless-all/app/scripts/write-updater-manifest.mjs', +]; + +for (const relativePath of repositoryReferences) { + const content = await readFile(join(repoRoot, relativePath), 'utf8'); + assert(!content.includes(legacyRepo), `${relativePath} still references the pre-transfer repository`); +} + +const tauriConfig = JSON.parse( + await readFile(join(repoRoot, 'openless-all/app/src-tauri/tauri.conf.json'), 'utf8'), +); +const updaterEndpoints = tauriConfig?.plugins?.updater?.endpoints; +assert(Array.isArray(updaterEndpoints) && updaterEndpoints.length > 0, 'desktop updater endpoints are missing'); +assert( + updaterEndpoints.every((endpoint) => endpoint.includes(currentRepo)), + 'desktop updater endpoints must use the current GitHub repository', +); + +console.log('repository-owner-contract.test.mjs passed'); diff --git a/openless-all/app/scripts/write-updater-manifest.mjs b/openless-all/app/scripts/write-updater-manifest.mjs index 92cecbaac..553044959 100755 --- a/openless-all/app/scripts/write-updater-manifest.mjs +++ b/openless-all/app/scripts/write-updater-manifest.mjs @@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url'; const target = process.env.OPENLESS_UPDATE_TARGET; const arch = process.env.OPENLESS_UPDATE_ARCH; -const repo = process.env.OPENLESS_UPDATE_REPO || 'appergb/openless'; +const repo = process.env.OPENLESS_UPDATE_REPO || 'Open-Less/openless'; const mirrorBaseUrl = process.env.OPENLESS_UPDATE_MIRROR_BASE_URL || 'https://fastgit.cc/https://github.com'; const rawChannel = (process.env.OPENLESS_RELEASE_CHANNEL || 'stable').toLowerCase(); if (rawChannel !== 'stable' && rawChannel !== 'beta') { diff --git a/openless-all/app/src-tauri/Cargo.lock b/openless-all/app/src-tauri/Cargo.lock index b2b0a751a..07f3a772d 100644 --- a/openless-all/app/src-tauri/Cargo.lock +++ b/openless-all/app/src-tauri/Cargo.lock @@ -3909,7 +3909,7 @@ dependencies = [ [[package]] name = "openless" -version = "1.3.15-Beta.1" +version = "1.3.15-Beta.2" dependencies = [ "anyhow", "arboard", diff --git a/openless-all/app/src-tauri/Cargo.toml b/openless-all/app/src-tauri/Cargo.toml index 62ee2c643..97559032c 100644 --- a/openless-all/app/src-tauri/Cargo.toml +++ b/openless-all/app/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openless" -version = "1.3.15-Beta.1" +version = "1.3.15-Beta.2" description = "OpenLess — local voice input that types where your cursor is" authors = ["OpenLess"] edition = "2021" diff --git a/openless-all/app/src-tauri/src/android/updater_logic.rs b/openless-all/app/src-tauri/src/android/updater_logic.rs index b6e743657..2fe833286 100644 --- a/openless-all/app/src-tauri/src/android/updater_logic.rs +++ b/openless-all/app/src-tauri/src/android/updater_logic.rs @@ -1,7 +1,7 @@ //! Pure Android updater helpers (manifest URLs, version compare). Testable on all targets. -pub const MIRROR_BASE: &str = "https://fastgit.cc/https://github.com/appergb/openless"; -pub const DIRECT_BASE: &str = "https://github.com/appergb/openless"; +pub const MIRROR_BASE: &str = "https://fastgit.cc/https://github.com/Open-Less/openless"; +pub const DIRECT_BASE: &str = "https://github.com/Open-Less/openless"; /// Must match `plugins.updater.pubkey` in `tauri.conf.json` (TAURI_SIGNING_PRIVATE_KEY pair). pub const UPDATER_PUBKEY_B64: &str = @@ -104,11 +104,11 @@ mod tests { let body = r#" 2026-07-15T07:00:00Z - + 2026-06-17T15:41:46Z - + "#; let latest = crate::commands::parse_latest_beta_from_atom(body) @@ -125,9 +125,9 @@ mod tests { #[test] fn beta_manifest_urls_skip_malformed_modern_tags_from_atom() { let body = r#" - - - + + + "#; let latest = crate::commands::parse_latest_beta_from_atom(body) .expect("Android updater must skip malformed Beta tags"); diff --git a/openless-all/app/src-tauri/src/commands/mod.rs b/openless-all/app/src-tauri/src/commands/mod.rs index 0c4ea100e..a3a483f0d 100644 --- a/openless-all/app/src-tauri/src/commands/mod.rs +++ b/openless-all/app/src-tauri/src/commands/mod.rs @@ -1261,13 +1261,13 @@ mod tests { tag:github.com,2008:Repository/X/v1.2.23-tauri 2026-05-07T09:05:00Z - + OpenLess v1.2.23-tauri tag:github.com,2008:Repository/X/v1.2.24-2-beta-tauri 2026-05-08T01:27:23Z - + OpenLess v1.2.24-2-beta-tauri "#; @@ -1275,7 +1275,7 @@ mod tests { assert_eq!(got.tag_name, "v1.2.24-2-beta-tauri"); assert_eq!( got.html_url, - "https://github.com/appergb/openless/releases/tag/v1.2.24-2-beta-tauri" + "https://github.com/Open-Less/openless/releases/tag/v1.2.24-2-beta-tauri" ); assert_eq!(got.published_at, "2026-05-08T01:27:23Z"); } @@ -1286,15 +1286,15 @@ mod tests { 2026-07-15T08:00:00Z - + 2026-07-15T07:00:00Z - + 2026-06-17T15:41:46Z - + "#; @@ -1307,21 +1307,21 @@ mod tests { #[test] fn parse_latest_beta_from_atom_skips_malformed_modern_tags() { let body = r#" - - - - - - - - - - - - + + + + + + + + + + + + 2026-07-15T07:00:00Z - + "#; @@ -1335,7 +1335,7 @@ mod tests { fn parse_latest_beta_from_atom_returns_none_when_only_stable_releases() { let body = r#" - + 2026-05-07T09:05:00Z "#; diff --git a/openless-all/app/src-tauri/src/commands/settings.rs b/openless-all/app/src-tauri/src/commands/settings.rs index 16f100797..2ca70335b 100644 --- a/openless-all/app/src-tauri/src/commands/settings.rs +++ b/openless-all/app/src-tauri/src/commands/settings.rs @@ -478,7 +478,7 @@ pub struct LatestBetaRelease { pub async fn fetch_latest_beta_release() -> Result, String> { let resp = net::send_with_retry(|| { net::http() - .get("https://github.com/appergb/openless/releases.atom") + .get("https://github.com/Open-Less/openless/releases.atom") .timeout(std::time::Duration::from_secs(15)) }) .await @@ -515,7 +515,7 @@ pub(crate) fn parse_latest_beta_from_atom(body: &str) -> Option", "").unwrap_or_default(); return Some(LatestBetaRelease { @@ -648,10 +648,10 @@ async fn resolve_beta_manifest_endpoints() -> Result, String> { // {{target}} / {{arch}} 占位符由 plugin 在 check 时替换。Rust raw string 用 r#""# // 不需要转义双花括号,比 format! 干净。 let mirror = format!( - "https://fastgit.cc/https://github.com/appergb/openless/releases/download/{tag}/latest-{{{{target}}}}-{{{{arch}}}}-beta-mirror.json" + "https://fastgit.cc/https://github.com/Open-Less/openless/releases/download/{tag}/latest-{{{{target}}}}-{{{{arch}}}}-beta-mirror.json" ); let direct = format!( - "https://github.com/appergb/openless/releases/download/{tag}/latest-{{{{target}}}}-{{{{arch}}}}-beta.json" + "https://github.com/Open-Less/openless/releases/download/{tag}/latest-{{{{target}}}}-{{{{arch}}}}-beta.json" ); let mirror_url = url::Url::parse(&mirror).map_err(|e| format!("parse beta mirror url: {e}"))?; let direct_url = url::Url::parse(&direct).map_err(|e| format!("parse beta direct url: {e}"))?; @@ -894,8 +894,8 @@ pub async fn app_download_and_install_android_update( ) -> Result<(), String> { // 安全:下载前校验 URL,防止 SSRF(如内网元数据接口、localhost 服务)。 // 只允许已知的 GitHub 直链和 fastgit 镜像前缀。 - const DIRECT_BASE: &str = "https://github.com/appergb/openless"; - const MIRROR_BASE: &str = "https://fastgit.cc/https://github.com/appergb/openless"; + const DIRECT_BASE: &str = "https://github.com/Open-Less/openless"; + const MIRROR_BASE: &str = "https://fastgit.cc/https://github.com/Open-Less/openless"; if !url.starts_with(DIRECT_BASE) && !url.starts_with(MIRROR_BASE) { return Err(format!("不信任的更新 URL,拒绝下载: {url}")); } diff --git a/openless-all/app/src-tauri/tauri.conf.json b/openless-all/app/src-tauri/tauri.conf.json index b20d33f2d..286babad3 100644 --- a/openless-all/app/src-tauri/tauri.conf.json +++ b/openless-all/app/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "OpenLess", - "version": "1.3.15-Beta.1", + "version": "1.3.15-Beta.2", "identifier": "com.openless.app", "build": { "beforeDevCommand": "npm run dev", @@ -101,8 +101,8 @@ "updater": { "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDFERUFBODAzNTY0QzMyM0YKUldRL01reFdBNmpxSGE1K0JadlpONXNWTzhJcGZCRGxjUVdIWExNNFJpeUNsSGZwazdlQThhemkK", "endpoints": [ - "https://github.com/appergb/openless/releases/latest/download/latest-{{target}}-{{arch}}.json", - "https://fastgit.cc/https://github.com/appergb/openless/releases/latest/download/latest-{{target}}-{{arch}}-mirror.json" + "https://github.com/Open-Less/openless/releases/latest/download/latest-{{target}}-{{arch}}.json", + "https://fastgit.cc/https://github.com/Open-Less/openless/releases/latest/download/latest-{{target}}-{{arch}}-mirror.json" ] } } diff --git a/openless-all/app/src/components/AutoUpdate.tsx b/openless-all/app/src/components/AutoUpdate.tsx index 0281a6457..9949c57ae 100644 --- a/openless-all/app/src/components/AutoUpdate.tsx +++ b/openless-all/app/src/components/AutoUpdate.tsx @@ -26,7 +26,7 @@ import { Btn } from '../pages/_atoms'; const UPDATE_CHECK_TIMEOUT_MS = 15_000; // 自动更新失败时的手动下载兜底:直达 GitHub Releases(与「关于」页 RELEASE_NOTES_URL 一致)。 -const RELEASE_DOWNLOAD_URL = 'https://github.com/appergb/openless/releases'; +const RELEASE_DOWNLOAD_URL = 'https://github.com/Open-Less/openless/releases'; export type UpdateStatus = | 'idle' diff --git a/openless-all/app/src/components/SettingsModal.tsx b/openless-all/app/src/components/SettingsModal.tsx index 2eb2eff40..3b33bf3ef 100644 --- a/openless-all/app/src/components/SettingsModal.tsx +++ b/openless-all/app/src/components/SettingsModal.tsx @@ -40,8 +40,8 @@ interface ModalNavItem { href?: string; } -const HELP_URL = 'https://github.com/appergb/openless#readme'; -const RELEASE_NOTES_URL = 'https://github.com/appergb/openless/releases'; +const HELP_URL = 'https://github.com/Open-Less/openless#readme'; +const RELEASE_NOTES_URL = 'https://github.com/Open-Less/openless/releases'; // 第一组:可选中的 tab;第二组:外部链接(永远不 active)。 const TAB_ITEMS: ModalNavItem[] = [ diff --git a/openless-all/app/src/pages/settings/AboutSection.tsx b/openless-all/app/src/pages/settings/AboutSection.tsx index 5915a7e68..978dc6bf4 100644 --- a/openless-all/app/src/pages/settings/AboutSection.tsx +++ b/openless-all/app/src/pages/settings/AboutSection.tsx @@ -14,8 +14,8 @@ import { Card } from '../_atoms'; import { btnGhostStyle, SectionTitle } from './shared'; import { CheckUpdateButton } from './CheckUpdateButton'; -const HELP_URL = 'https://github.com/appergb/openless#readme'; -const RELEASE_NOTES_URL = 'https://github.com/appergb/openless/releases'; +const HELP_URL = 'https://github.com/Open-Less/openless#readme'; +const RELEASE_NOTES_URL = 'https://github.com/Open-Less/openless/releases'; export function AboutSection() { const { t } = useTranslation(); @@ -67,7 +67,7 @@ export function AboutSection() { {t('settings.about.linksTitle')} - @@ -87,7 +87,7 @@ export function AboutSection() { - @@ -110,4 +110,3 @@ export function AboutSection() { ); } -