Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🔨 chore: improve electron build workflow (#12054)

Arvin Xu6977c570e624
diff --git a/.github/actions/desktop-build-setup/action.yml b/.github/actions/desktop-build-setup/action.yml
index 37c312e4d58..4cd2c5d27b6 100644
--- a/.github/actions/desktop-build-setup/action.yml
+++ b/.github/actions/desktop-build-setup/action.yml
@@ -24,6 +24,17 @@ runs:
shell: bash
run: pnpm install --node-linker=hoisted
+ # 移除国内 electron 镜像配置,GitHub Actions 使用官方源更快
+ - name: Remove China electron mirror from .npmrc
+ shell: bash
+ run: |
+ NPMRC_FILE="./apps/desktop/.npmrc"
+ if [ -f "$NPMRC_FILE" ]; then
+ sed -i.bak '/^electron_mirror=/d; /^electron_builder_binaries_mirror=/d' "$NPMRC_FILE"
+ rm -f "${NPMRC_FILE}.bak"
+ echo "✅ Removed electron mirror config from .npmrc"
+ fi
+
- name: Install deps on Desktop
shell: bash
run: npm run install-isolated --prefix=./apps/desktop
diff --git a/.github/workflows/pr-build-desktop.yml b/.github/workflows/pr-build-desktop.yml
index 66de96c989b..54f576e24f6 100644
--- a/.github/workflows/pr-build-desktop.yml
+++ b/.github/workflows/pr-build-desktop.yml
@@ -109,6 +109,17 @@ jobs:
- name: Install dependencies
run: pnpm install --node-linker=hoisted
+ # 移除国内 electron 镜像配置,GitHub Actions 使用官方源更快
+ - name: Remove China electron mirror from .npmrc
+ shell: bash
+ run: |
+ NPMRC_FILE="./apps/desktop/.npmrc"
+ if [ -f "$NPMRC_FILE" ]; then
+ sed -i.bak '/^electron_mirror=/d; /^electron_builder_binaries_mirror=/d' "$NPMRC_FILE"
+ rm -f "${NPMRC_FILE}.bak"
+ echo "✅ Removed electron mirror config from .npmrc"
+ fi
+
- name: Install deps on Desktop
run: npm run install-isolated --prefix=./apps/desktop