-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Generate Screenshots | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
screenshot: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ">=3.7 <3.12" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
Invoke-WebRequest -Uri "https://www.nirsoft.net/utils/nircmd.zip" -OutFile "nircmd.zip" | ||
Expand-Archive -Path "nircmd.zip" -DestinationPath "C:\nircmd" | ||
echo "C:\nircmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 | ||
- name: Run app and take screenshot | ||
run: | | ||
# get version from version.py | ||
$version = (Get-Content torf_gui\version.py | Select-String -Pattern '__version__ = "(.*)"').Matches.Groups[1].Value | ||
# debug print version | ||
Write-Host "Version: $version" | ||
# start app | ||
Start-Process -NoNewWindow -FilePath "python" -ArgumentList "torf_gui/gui.py" | ||
# wait for app to start | ||
Start-Sleep -Seconds 5 | ||
# take screenshot | ||
nircmd savescreenshotwin "torf-gui $version" screenshot-light.png | ||
shell: powershell | ||
|
||
- name: Upload screenshot | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: screenshot-light | ||
path: screenshot-light.png |