Skip to content

Commit 82c48b9

Browse files
authored
🐛 fix: fix window close issue and release Window/Linux beta (lobehub#7780)
* fix window close issue * try to fix win loading * try to fix win build * try to fix win build * fix win build issue * fix win build issue
1 parent 294790b commit 82c48b9

File tree

5 files changed

+46
-14
lines changed

5 files changed

+46
-14
lines changed

.github/workflows/desktop-pr-build.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
runs-on: ${{ matrix.os }}
9494
strategy:
9595
matrix:
96-
os: [macos-latest, windows-latest, ubuntu-latest]
96+
os: [macos-latest, windows-2025, ubuntu-latest]
9797
steps:
9898
- uses: actions/checkout@v4
9999
with:
@@ -143,9 +143,9 @@ jobs:
143143
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
144144
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
145145

146-
# 非 macOS 平台构建处理
147-
- name: Build artifact on other platforms
148-
if: runner.os != 'macOS'
146+
# Windows 平台构建处理
147+
- name: Build artifact on Windows
148+
if: runner.os == 'Windows'
149149
run: npm run desktop:build
150150
env:
151151
# 设置更新通道,PR构建为nightly,否则为stable
@@ -155,7 +155,22 @@ jobs:
155155
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
156156
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_PROJECT_ID }}
157157
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_BASE_URL }}
158+
# 将 TEMP 和 TMP 目录设置到 D 盘
159+
TEMP: D:\temp
160+
TMP: D:\temp
158161

162+
# Linux 平台构建处理
163+
- name: Build artifact on Linux
164+
if: runner.os == 'Linux'
165+
run: npm run desktop:build
166+
env:
167+
# 设置更新通道,PR构建为nightly,否则为stable
168+
UPDATE_CHANNEL: 'nightly'
169+
APP_URL: http://localhost:3015
170+
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
171+
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
172+
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_PROJECT_ID }}
173+
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_BASE_URL }}
159174

160175
# 上传构建产物
161176
- name: Upload artifact

.github/workflows/release-desktop-beta.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ jobs:
8080
runs-on: ${{ matrix.os }}
8181
strategy:
8282
matrix:
83-
# 暂时先支持 macOS
84-
os: [macos-latest]
85-
# os: [macos-latest, windows-latest, ubuntu-latest]
83+
os: [macos-latest, windows-2025, ubuntu-latest]
8684
steps:
8785
- uses: actions/checkout@v4
8886
with:
@@ -130,16 +128,30 @@ jobs:
130128
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
131129
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
132130

133-
# 非 macOS 平台构建处理
134-
- name: Build artifact on other platforms
135-
if: runner.os != 'macOS'
131+
# Windows 平台构建处理
132+
- name: Build artifact on Windows
133+
if: runner.os == 'Windows'
136134
run: npm run desktop:build
137135
env:
138136
APP_URL: http://localhost:3015
139137
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
140138
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
141-
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
142-
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
139+
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_PROJECT_ID }}
140+
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_BASE_URL }}
141+
# 将 TEMP 和 TMP 目录设置到 D 盘
142+
TEMP: D:\temp
143+
TMP: D:\temp
144+
145+
# Linux 平台构建处理
146+
- name: Build artifact on Linux
147+
if: runner.os == 'Linux'
148+
run: npm run desktop:build
149+
env:
150+
APP_URL: http://localhost:3015
151+
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
152+
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
153+
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_PROJECT_ID }}
154+
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_BASE_URL }}
143155

144156
# 上传构建产物,移除了 zip 相关部分
145157
- name: Upload artifact

apps/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@types/set-cookie-parser": "^2.4.10",
4848
"consola": "^3.1.0",
4949
"cookie": "^1.0.2",
50-
"electron": "^35.2.0",
50+
"electron": "^36.2.0",
5151
"electron-builder": "^26.0.12",
5252
"electron-is": "^3.0.0",
5353
"electron-log": "^5.3.3",

apps/desktop/src/main/core/BrowserManager.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ export default class BrowserManager {
161161
if (browser.webContents) this.webContentsMap.delete(browser.webContents);
162162
});
163163

164+
browser.browserWindow.on('show', () => {
165+
if (browser.webContents)
166+
this.webContentsMap.set(browser.webContents, browser.identifier as AppBrowsersIdentifiers);
167+
});
168+
164169
return browser;
165170
}
166171

src/features/ElectronTitlebar/WinControl/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const useStyles = createStyles(({ css, cx, token }) => {
1212
align-items: center;
1313
justify-content: center;
1414
15-
width: 64px;
15+
width: 40px;
1616
min-height: ${TITLE_BAR_HEIGHT}px;
1717
1818
color: ${token.colorTextSecondary};

0 commit comments

Comments
 (0)