Skip to content

Commit 5d7698f

Browse files
Add screenshot publishing workflow and update CI
Introduces a new GitHub Actions workflow to publish screenshots after successful CI runs. Also updates the Windows configuration step in the CI workflow to minimize all windows before running tests.
1 parent 4b989ab commit 5d7698f

2 files changed

Lines changed: 77 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
working-directory: build/tests
137137
run: ./test_tray --gtest_color=yes --gtest_filter=TrayTest.TestTrayInit
138138

139-
- name: Configure Windows Tray and Notifications
139+
- name: Configure Windows
140140
if: runner.os == 'Windows'
141141
shell: pwsh
142142
run: |
@@ -147,13 +147,25 @@ jobs:
147147
.\Enable-AllTrayIcons.ps1 -Action Enable -Force # Enable with comprehensive method (resets ALL icon settings)
148148
149149
# Disable Do Not Disturb
150-
$quietHoursPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\QuietHours"
151-
New-Item -Path $quietHoursPath -Force | Out-Null
152-
Set-ItemProperty -Path $quietHoursPath -Name "Enabled" -Value 0
153-
Set-ItemProperty -Path $quietHoursPath -Name "Profile" -Value "Unrestricted"
150+
Add-Type -AssemblyName System.Windows.Forms
151+
Start-Process "ms-settings:notifications"
152+
Start-Sleep -Seconds 2
153+
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
154+
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
155+
[System.Windows.Forms.SendKeys]::SendWait(" ")
154156
155-
# Restart notification services
156-
Get-Service -Name "WpnUserService_*" | Restart-Service -Force
157+
# Disable Quiet Hours via Group Policy
158+
Set-GPRegistryValue `
159+
-Name "Local Group Policy" `
160+
-Key "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings" `
161+
-ValueName "QuietHours" `
162+
-Type DWord `
163+
-Value 0
164+
Invoke-GPUpdate -Force
165+
166+
# Minimize all windows
167+
$shell = New-Object -ComObject Shell.Application
168+
$shell.MinimizeAll()
157169
158170
- name: Run tests
159171
id: test
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Publish Screenshots
3+
4+
on:
5+
workflow_run:
6+
workflows: ["CI"]
7+
types:
8+
- completed
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
publish:
16+
if: github.event.workflow_run.conclusion == 'success'
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Download Artifacts
20+
uses: actions/download-artifact@v7
21+
with:
22+
path: screenshots
23+
pattern: tray-screenshots-*
24+
run-id: ${{ github.event.workflow_run.id }}
25+
26+
- name: Debug screenshots
27+
run: ls -R screenshots
28+
29+
- name: Determine Branch and Path
30+
id: determine
31+
env:
32+
PULL_REQUEST_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
33+
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
34+
run: |
35+
if [ -n "${PULL_REQUEST_NUMBER}" ]; then
36+
PR_NUMBER=${PULL_REQUEST_NUMBER}
37+
BRANCH_PATH="PR-${PULL_REQUEST_NUMBER}"
38+
is_pr=true
39+
else
40+
BRANCH_NAME=$(echo "${HEAD_BRANCH}" | sed 's/\//-/g')
41+
BRANCH_PATH="${BRANCH_NAME}"
42+
is_pr=false
43+
fi
44+
45+
{
46+
echo "branch_path=${BRANCH_PATH}"
47+
echo "is_pr=${is_pr}"
48+
echo "pr_number=${PR_NUMBER}"
49+
} >> "${GITHUB_OUTPUT}"
50+
51+
# debug outputs
52+
cat "${GITHUB_OUTPUT}"
53+
54+
- name: Checkout Screenshots Branch
55+
uses: actions/checkout@v6
56+
with:
57+
ref: screenshots
58+
path: screenshots-repo

0 commit comments

Comments
 (0)