diff --git a/.github/workflows/dev-daily-fixed.yml b/.github/workflows/dev-daily-fixed.yml index 3068e3d..0f1ef3e 100644 --- a/.github/workflows/dev-daily-fixed.yml +++ b/.github/workflows/dev-daily-fixed.yml @@ -52,7 +52,7 @@ jobs: if gh release view "$FIXED_DEV_TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then gh release edit "$FIXED_DEV_TAG" --repo "$GITHUB_REPOSITORY" --title "Daily Dev Build" --prerelease else - gh release create "$FIXED_DEV_TAG" --repo "$GITHUB_REPOSITORY" --title "Daily Dev Build" --notes "固定开发版发布页(每日覆盖更新)" --prerelease + gh release create "$FIXED_DEV_TAG" --repo "$GITHUB_REPOSITORY" --title "Daily Dev Build" --notes "开发版发布页" --prerelease fi dev-mac-arm64: @@ -91,7 +91,12 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash run: | - gh release upload "$FIXED_DEV_TAG" release/* --repo "$GITHUB_REPOSITORY" --clobber + mapfile -t assets < <(find release -maxdepth 1 -type f | sort) + if [ "${#assets[@]}" -eq 0 ]; then + echo "No release files found in ./release" + exit 1 + fi + gh release upload "$FIXED_DEV_TAG" "${assets[@]}" --repo "$GITHUB_REPOSITORY" --clobber dev-linux: needs: prepare @@ -129,7 +134,12 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash run: | - gh release upload "$FIXED_DEV_TAG" release/* --repo "$GITHUB_REPOSITORY" --clobber + mapfile -t assets < <(find release -maxdepth 1 -type f | sort) + if [ "${#assets[@]}" -eq 0 ]; then + echo "No release files found in ./release" + exit 1 + fi + gh release upload "$FIXED_DEV_TAG" "${assets[@]}" --repo "$GITHUB_REPOSITORY" --clobber dev-win-x64: needs: prepare @@ -167,7 +177,12 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash run: | - gh release upload "$FIXED_DEV_TAG" release/* --repo "$GITHUB_REPOSITORY" --clobber + mapfile -t assets < <(find release -maxdepth 1 -type f | sort) + if [ "${#assets[@]}" -eq 0 ]; then + echo "No release files found in ./release" + exit 1 + fi + gh release upload "$FIXED_DEV_TAG" "${assets[@]}" --repo "$GITHUB_REPOSITORY" --clobber dev-win-arm64: needs: prepare @@ -205,4 +220,87 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash run: | - gh release upload "$FIXED_DEV_TAG" release/* --repo "$GITHUB_REPOSITORY" --clobber + mapfile -t assets < <(find release -maxdepth 1 -type f | sort) + if [ "${#assets[@]}" -eq 0 ]; then + echo "No release files found in ./release" + exit 1 + fi + gh release upload "$FIXED_DEV_TAG" "${assets[@]}" --repo "$GITHUB_REPOSITORY" --clobber + + update-dev-release-notes: + needs: + - prepare + - dev-mac-arm64 + - dev-linux + - dev-win-x64 + - dev-win-arm64 + if: always() && needs.prepare.result == 'success' + runs-on: ubuntu-latest + steps: + - name: Update fixed dev release notes + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FIXED_DEV_TAG: ${{ env.FIXED_DEV_TAG }} + shell: bash + run: | + set -euo pipefail + + TAG="$FIXED_DEV_TAG" + REPO="$GITHUB_REPOSITORY" + RELEASE_PAGE="https://github.com/$REPO/releases/tag/$TAG" + + if ! gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1; then + echo "Release $TAG not found, skip notes update." + exit 0 + fi + + ASSETS_JSON="$(gh release view "$TAG" --repo "$REPO" --json assets)" + + pick_asset() { + local pattern="$1" + echo "$ASSETS_JSON" | jq -r --arg p "$pattern" '[.assets[].name | select(test($p))][0] // ""' + } + + WINDOWS_ASSET="$(pick_asset "dev-x64-Setup[.]exe$")" + WINDOWS_ARM64_ASSET="$(pick_asset "dev-arm64-Setup[.]exe$")" + MAC_ASSET="$(pick_asset "dev-arm64[.]dmg$")" + LINUX_TAR_ASSET="$(pick_asset "dev-linux[.]tar[.]gz$")" + LINUX_APPIMAGE_ASSET="$(pick_asset "dev-linux[.]AppImage$")" + + build_link() { + local name="$1" + if [ -n "$name" ]; then + echo "https://github.com/$REPO/releases/download/$TAG/$name" + fi + } + + WINDOWS_URL="$(build_link "$WINDOWS_ASSET")" + WINDOWS_ARM64_URL="$(build_link "$WINDOWS_ARM64_ASSET")" + MAC_URL="$(build_link "$MAC_ASSET")" + LINUX_TAR_URL="$(build_link "$LINUX_TAR_ASSET")" + LINUX_APPIMAGE_URL="$(build_link "$LINUX_APPIMAGE_ASSET")" + + cat > dev_release_notes.md </dev/null 2>&1; then + echo "Release $TAG not found (possibly all publish jobs failed), skip notes update." + exit 0 + fi + + ASSETS_JSON="$(gh release view "$TAG" --repo "$REPO" --json assets)" + + pick_asset() { + local pattern="$1" + echo "$ASSETS_JSON" | jq -r --arg p "$pattern" '[.assets[].name | select(test($p))][0] // ""' + } + + WINDOWS_ASSET="$(pick_asset "x64.*[.]exe$")" + if [ -z "$WINDOWS_ASSET" ]; then + WINDOWS_ASSET="$(echo "$ASSETS_JSON" | jq -r '[.assets[].name | select(test("[.]exe$")) | select(test("arm64") | not)][0] // ""')" + fi + WINDOWS_ARM64_ASSET="$(pick_asset "arm64.*[.]exe$")" + MAC_ASSET="$(pick_asset "[.]dmg$")" + LINUX_TAR_ASSET="$(pick_asset "[.]tar[.]gz$")" + LINUX_APPIMAGE_ASSET="$(pick_asset "[.]AppImage$")" + + build_link() { + local name="$1" + if [ -n "$name" ]; then + echo "https://github.com/$REPO/releases/download/$TAG/$name" + fi + } + + WINDOWS_URL="$(build_link "$WINDOWS_ASSET")" + WINDOWS_ARM64_URL="$(build_link "$WINDOWS_ARM64_ASSET")" + MAC_URL="$(build_link "$MAC_ASSET")" + LINUX_TAR_URL="$(build_link "$LINUX_TAR_ASSET")" + LINUX_APPIMAGE_URL="$(build_link "$LINUX_APPIMAGE_ASSET")" + + cat > preview_release_notes.md < 如某个平台链接暂未生成,请前往发布页查看最新资源:$RELEASE_PAGE + EOF + + gh release edit "$TAG" --repo "$REPO" --notes-file preview_release_notes.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3fe7694..f96237d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -276,11 +276,10 @@ jobs: - Windows arm64: ${WINDOWS_ARM64_URL:-$RELEASE_PAGE} - macOS(M系列芯片): ${MAC_URL:-$RELEASE_PAGE} - Linux (.tar.gz): ${LINUX_TAR_URL:-$RELEASE_PAGE} - - linux (.AppImage): ${LINUX_APPIMAGE_URL:-$RELEASE_PAGE} + - Linux (.AppImage): ${LINUX_APPIMAGE_URL:-$RELEASE_PAGE} - ## macOS 安装提示(未知来源) - - 若打开时提示“来自未知开发者”或“无法验证开发者”,请到「系统设置 -> 隐私与安全性」中允许打开该应用。 - - 如果仍被系统拦截,请在终端执行以下命令去除隔离标记: + ## macOS 安装提示 + - 如果被系统提升已损坏,你需要在终端执行以下命令去除隔离标记: - \`xattr -dr com.apple.quarantine "/Applications/WeFlow.app"\` - 执行后重新打开 WeFlow。 diff --git a/electron/main.ts b/electron/main.ts index 57be647..355693a 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -57,9 +57,13 @@ const normalizeUpdateTrack = (raw: unknown): 'stable' | 'preview' | 'dev' | null return null } -const applyAutoUpdateChannel = (reason: 'startup' | 'settings' = 'startup') => { +const getEffectiveUpdateTrack = (): 'stable' | 'preview' | 'dev' => { const configuredTrack = normalizeUpdateTrack(configService?.get('updateChannel')) - const track: 'stable' | 'preview' | 'dev' = configuredTrack || defaultUpdateTrack + return configuredTrack || defaultUpdateTrack +} + +const applyAutoUpdateChannel = (reason: 'startup' | 'settings' = 'startup') => { + const track = getEffectiveUpdateTrack() const baseUpdateChannel = track === 'stable' ? 'latest' : track autoUpdater.allowPrerelease = track !== 'stable' autoUpdater.allowDowngrade = isPrereleaseBuild && track === 'stable' @@ -273,6 +277,14 @@ const normalizeReleaseNotes = (rawReleaseNotes: unknown): string => { return cleaned } +const getDialogReleaseNotes = (rawReleaseNotes: unknown): string => { + const track = getEffectiveUpdateTrack() + if (track !== 'stable') { + return '修复了一些已知问题' + } + return normalizeReleaseNotes(rawReleaseNotes) +} + type AnnualReportYearsLoadStrategy = 'cache' | 'native' | 'hybrid' type AnnualReportYearsLoadPhase = 'cache' | 'native' | 'scan' | 'done' @@ -1275,7 +1287,7 @@ function registerIpcHandlers() { return { hasUpdate: true, version: latestVersion, - releaseNotes: normalizeReleaseNotes(result.updateInfo.releaseNotes), + releaseNotes: getDialogReleaseNotes(result.updateInfo.releaseNotes), minimumVersion: (result.updateInfo as any).minimumVersion } } @@ -2740,7 +2752,7 @@ function checkForUpdatesOnStartup() { // 通知渲染进程有新版本 mainWindow.webContents.send('app:updateAvailable', { version: latestVersion, - releaseNotes: normalizeReleaseNotes(result.updateInfo.releaseNotes), + releaseNotes: getDialogReleaseNotes(result.updateInfo.releaseNotes), minimumVersion: (result.updateInfo as any).minimumVersion }) } diff --git a/package-lock.json b/package-lock.json index 94310c8..731af00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "jieba-wasm": "^2.2.0", "jszip": "^3.10.1", "koffi": "^2.9.0", - "lucide-react": "^0.562.0", + "lucide-react": "^1.7.0", "react": "^19.2.3", "react-dom": "^19.2.3", "react-markdown": "^10.1.0", @@ -42,7 +42,7 @@ "electron-builder": "^26.8.1", "sass": "^1.98.0", "sharp": "^0.34.5", - "typescript": "^5.6.3", + "typescript": "^6.0.2", "vite": "^7.0.0", "vite-plugin-electron": "^0.28.8", "vite-plugin-electron-renderer": "^0.14.6" @@ -6746,9 +6746,9 @@ } }, "node_modules/lucide-react": { - "version": "0.562.0", - "resolved": "https://registry.npmmirror.com/lucide-react/-/lucide-react-0.562.0.tgz", - "integrity": "sha512-82hOAu7y0dbVuFfmO4bYF1XEwYk/mEbM5E+b1jgci/udUBEE/R7LF5Ip0CCEmXe8AybRM8L+04eP+LGZeDvkiw==", + "version": "1.7.0", + "resolved": "https://registry.npmmirror.com/lucide-react/-/lucide-react-1.7.0.tgz", + "integrity": "sha512-yI7BeItCLZJTXikmK4KNUGCKoGzSvbKlfCvw44bU4fXAL6v3gYS4uHD1jzsLkfwODYwI6Drw5Tu9Z5ulDe0TSg==", "license": "ISC", "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" @@ -9785,9 +9785,9 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-6.0.2.tgz", + "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 43011e2..3980c38 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "jieba-wasm": "^2.2.0", "jszip": "^3.10.1", "koffi": "^2.9.0", - "lucide-react": "^0.562.0", + "lucide-react": "^1.7.0", "react": "^19.2.3", "react-dom": "^19.2.3", "react-markdown": "^10.1.0", @@ -56,7 +56,7 @@ "electron-builder": "^26.8.1", "sass": "^1.98.0", "sharp": "^0.34.5", - "typescript": "^5.6.3", + "typescript": "^6.0.2", "vite": "^7.0.0", "vite-plugin-electron": "^0.28.8", "vite-plugin-electron-renderer": "^0.14.6" @@ -102,7 +102,25 @@ "target": [ "nsis" ], - "icon": "public/icon.ico" + "icon": "public/icon.ico", + "extraFiles": [ + { + "from": "resources/msvcp140.dll", + "to": "." + }, + { + "from": "resources/msvcp140_1.dll", + "to": "." + }, + { + "from": "resources/vcruntime140.dll", + "to": "." + }, + { + "from": "resources/vcruntime140_1.dll", + "to": "." + } + ] }, "linux": { "icon": "public/icon.png", @@ -170,24 +188,6 @@ "node_modules/sherpa-onnx-*/**/*", "node_modules/ffmpeg-static/**/*" ], - "extraFiles": [ - { - "from": "resources/msvcp140.dll", - "to": "." - }, - { - "from": "resources/msvcp140_1.dll", - "to": "." - }, - { - "from": "resources/vcruntime140.dll", - "to": "." - }, - { - "from": "resources/vcruntime140_1.dll", - "to": "." - } - ], "icon": "resources/icon.icns" }, "overrides": {