Repository navigation
109 lines (96 loc) · 4.09 KB
/
Copy pathdiagnostic-artifact.yml
File metadata and controls
109 lines (96 loc) · 4.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Diagnostic artifact
on:
push:
branches: [main, "release/**"]
# Release branches too: a recording fix targeting a release is exactly when a
# reviewer needs the compiled helper, and filtering on main alone meant
# retargeting a PR silently removed the artifact its own test steps ask for.
pull_request:
branches: [main, "release/**"]
workflow_dispatch:
permissions:
contents: read
jobs:
build-windows:
name: Windows x64 diagnostic bundle
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- name: Build native helper
run: npm run build:native:win
- name: Bundle diagnostic tool
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$bundle = "openscreen-diagnostic-windows-x64"
$staging = New-Item -ItemType Directory -Path "$bundle"
Copy-Item scripts/diagnostic-tool/diagnostic.mjs -Destination $staging
Copy-Item scripts/diagnostic-tool/diagnostic.bat -Destination $staging
Copy-Item scripts/diagnostic-tool/README.md -Destination $staging
New-Item -ItemType Directory -Path "$staging/helpers/win32-x64" | Out-Null
Copy-Item electron/native/bin/win32-x64/wgc-capture.exe -Destination "$staging/helpers/win32-x64/"
Compress-Archive -Path "$staging" -DestinationPath "$bundle.zip"
- name: Smoke-test the bundle
shell: pwsh
# The actual capture path is exercised by users with a real desktop
# session. A non-interactive runner has no display, so WGC cannot
# capture frames and the helper exits before emitting [stop-timing].
# Validate bundle structure + CLI parser instead of running capture.
run: |
$ErrorActionPreference = "Stop"
Expand-Archive -Path openscreen-diagnostic-windows-x64.zip -DestinationPath smoke
$smoke = Resolve-Path "smoke/openscreen-diagnostic-windows-x64"
foreach ($rel in @(
"diagnostic.mjs",
"diagnostic.bat",
"README.md",
"helpers/win32-x64/wgc-capture.exe"
)) {
$p = Join-Path $smoke $rel
if (-not (Test-Path $p)) { throw "Smoke test: missing $rel" }
}
& "$smoke/diagnostic.bat" --help | Out-Null
if ($LASTEXITCODE -ne 0) { throw "diagnostic.bat --help exited $LASTEXITCODE" }
- name: Upload Windows diagnostic bundle
uses: actions/upload-artifact@v7
with:
name: openscreen-diagnostic-windows-x64
path: openscreen-diagnostic-windows-x64.zip
if-no-files-found: error
retention-days: 14
build-macos:
name: macOS ${{ matrix.arch }} diagnostic bundle
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: [arm64, x64]
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- name: Build native helper
run: npm run build:native:mac
env:
OPENSCREEN_MAC_HELPER_ARCHS: ${{ matrix.arch }}
- name: Bundle diagnostic tool
run: |
set -euo pipefail
arch="${{ matrix.arch }}"
arch_tag="darwin-$([ "$arch" = "x64" ] && echo x64 || echo arm64)"
bundle="openscreen-diagnostic-macos-$arch"
rm -rf "$bundle" "$bundle.tar.gz"
mkdir -p "$bundle/helpers/$arch_tag"
cp scripts/diagnostic-tool/diagnostic.mjs "$bundle/"
cp scripts/diagnostic-tool/diagnostic.sh "$bundle/"
cp scripts/diagnostic-tool/README.md "$bundle/"
cp "electron/native/bin/$arch_tag/openscreen-screencapturekit-helper" "$bundle/helpers/$arch_tag/"
chmod +x "$bundle/diagnostic.sh" "$bundle/helpers/$arch_tag/openscreen-screencapturekit-helper"
tar -czf "$bundle.tar.gz" "$bundle"
- name: Upload macOS diagnostic bundle
uses: actions/upload-artifact@v7
with:
name: openscreen-diagnostic-macos-${{ matrix.arch }}
path: openscreen-diagnostic-macos-${{ matrix.arch }}.tar.gz
if-no-files-found: error
retention-days: 14