Skip to content

Commit 9930ca9

Browse files
authored
fix: enable trace feature on Windows and refine release workflow (#120)
- Remove platform restriction in `httpServer.ts` to allow serving trace resources on Windows- Optimize `release.yaml` - Correct file matching patterns for trace artifact copying - Remove redundant `build:lynx-trace` step from build-and-upload-windows job - Use `sync:devtools-dist` for DevTools Frontend setup to fix white screen issue caused by incorrect manual extraction
1 parent 0709721 commit 9930ca9

2 files changed

Lines changed: 13 additions & 24 deletions

File tree

.github/workflows/release.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ jobs:
126126
- name: Build devtools-gn
127127
run: pnpm run build:devtools
128128

129-
- name: Sync devtools-dist
130-
run: pnpm run sync:devtools-dist
131-
132129
- name: Find Frontend Archive
133130
id: find_frontend
134131
run: |
@@ -208,12 +205,15 @@ jobs:
208205
name: devtools-frontend-lynx
209206
path: temp-frontend
210207

211-
- name: Extract DevTools Frontend
208+
- name: Setup DevTools Frontend
212209
run: |
213210
mkdir -p packages/devtools-frontend-lynx/output
214211
ARCHIVE_PATH=$(find temp-frontend -name "devtool.frontend.lynx_*.tar.gz" | head -n 1)
215-
tar -xzf "$ARCHIVE_PATH" -C packages/devtools-frontend-lynx/output
216-
echo "DevTools Frontend extracted successfully"
212+
mv "$ARCHIVE_PATH" packages/devtools-frontend-lynx/output/
213+
echo "DevTools Frontend archive moved successfully"
214+
215+
- name: Sync DevTools Frontend
216+
run: pnpm run sync:devtools-dist
217217

218218
- name: Build lynx-trace
219219
run: pnpm run build:lynx-trace
@@ -323,16 +323,16 @@ jobs:
323323
name: devtools-frontend-lynx
324324
path: temp-frontend
325325

326-
- name: Extract DevTools Frontend
326+
- name: Setup DevTools Frontend
327327
shell: pwsh
328328
run: |
329329
New-Item -ItemType Directory -Force -Path "packages\devtools-frontend-lynx\output"
330330
$archivePath = Get-ChildItem -Path "temp-frontend" -Filter "devtool.frontend.lynx_*.tar.gz" | Select-Object -First 1 -ExpandProperty FullName
331-
tar -xzf "$archivePath" -C "packages\devtools-frontend-lynx\output"
332-
Write-Host "DevTools Frontend extracted successfully"
331+
Move-Item -Path $archivePath -Destination "packages\devtools-frontend-lynx\output" -Force
332+
Write-Host "DevTools Frontend archive moved successfully"
333333
334-
- name: Skip lynx-trace build on Windows
335-
run: pnpm run build:lynx-trace
334+
- name: Sync DevTools Frontend
335+
run: pnpm run sync:devtools-dist
336336

337337
- name: Download lynx-trace prebuilt artifact
338338
uses: robinraju/release-downloader@v1
@@ -347,7 +347,7 @@ jobs:
347347
shell: pwsh
348348
run: |
349349
Write-Host "Copying prebuilt lynx-trace artifact..." -ForegroundColor Cyan
350-
$sourceFile = Get-ChildItem -Path "temp-lynx-trace" -Filter "perfetto-ui-release-*.tar.gz" | Select-Object -First 1
350+
$sourceFile = Get-ChildItem -Path "temp-lynx-trace" -Filter "perfetto-ui-*.tar.gz" | Select-Object -First 1
351351
$destPath = "packages\lynx-devtool-cli\resources\lynx-trace.tar.gz"
352352
353353
if ($sourceFile) {

packages/lynx-devtool-cli/src/cli/command/httpServer.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,7 @@ class HttpServer {
7474
app.use('/localResource/file', express.static(filePath));
7575
app.use('/localResource/devtool', express.static(devtoolPath, disableCacheConfig));
7676

77-
// Skip trace on Windows as it's not supported
78-
if (process.platform !== 'win32') {
79-
app.use('/localResource/trace', express.static(tracePath));
80-
} else {
81-
// Return 503 Service Unavailable for trace requests on Windows
82-
app.use('/localResource/trace', (req, res) => {
83-
res.status(503).json({
84-
error: 'Trace feature is not available on Windows platform',
85-
message: 'lynx-trace build is not supported on Windows. Please use macOS or Linux.'
86-
});
87-
});
88-
}
77+
app.use('/localResource/trace', express.static(tracePath));
8978

9079
// apis
9180
app.post('/uploadFileToLocal', (req: any, res: any) => {

0 commit comments

Comments
 (0)