feat: Add build version to the Windows build #12
Workflow file for this run
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
name: Test Windows Build | |
on: | |
workflow_dispatch: # Manual trigger | |
pull_request: # Optionally trigger on PRs | |
jobs: | |
build_windows_test: | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: monitor-app | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pillow | |
- name: Set test version | |
run: | | |
$timestamp = Get-Date -Format "yyyyMMdd-HHmm" | |
# Read version from version.py and append timestamp | |
$version = (Get-Content version.py | Select-String 'VERSION = "(.*)"').Matches.Groups[1].Value | |
$testVersion = "$version-test-$timestamp" | |
echo "VERSION=$testVersion" >> $env:GITHUB_ENV | |
# Update version.py with test version | |
(Get-Content version.py) -replace 'VERSION = ".*"', "VERSION = `"$testVersion`"" | Set-Content version.py | |
- name: Build executable | |
run: | | |
pyinstaller --clean disco_beacon.spec | |
- name: Upload test artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DiscoBeacon_Windows_Test_${{ env.VERSION }} | |
path: ${{ github.workspace }}/monitor-app/dist/DiscoBeacon.exe | |
retention-days: 5 |