Skip to content

Fix Windows Search database lock handling (#1) #2

Fix Windows Search database lock handling (#1)

Fix Windows Search database lock handling (#1) #2

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
windows-exe:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install build dependencies
run: python -m pip install --upgrade pip pyinstaller pytest
- name: Install package
run: python -m pip install .
- name: Run tests
run: python -m pytest -q
- name: Create PyInstaller entry point
shell: pwsh
run: |
@(
'from win_search_aliases.ui.gui import main'
''
'raise SystemExit(main())'
) | Set-Content -LiteralPath pyinstaller_entry.py -Encoding UTF8
- name: Build Windows UI executable
run: >
python -m PyInstaller
--noconfirm
--clean
--onefile
--windowed
--icon assets/app.ico
--name win-search-aliases-ui-${{ github.ref_name }}
--collect-data win_search_aliases
--exclude-module _hashlib
--exclude-module _ssl
--exclude-module ssl
pyinstaller_entry.py
- name: Verify executable exists
shell: pwsh
run: |
$exe = Join-Path $PWD 'dist\win-search-aliases-ui-${{ github.ref_name }}.exe'
if (-not (Test-Path -LiteralPath $exe)) {
throw "Built executable was not found: $exe"
}
Get-Item -LiteralPath $exe | Format-List Name,Length,FullName
- name: Smoke test executable
shell: pwsh
run: |
$exe = Join-Path $PWD 'dist\win-search-aliases-ui-${{ github.ref_name }}.exe'
$process = Start-Process -FilePath $exe -ArgumentList '--smoke-test' -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -ne 0) {
throw "Executable smoke test failed with exit code $($process.ExitCode)"
}
- uses: actions/upload-artifact@v4
with:
name: win-search-aliases-ui-${{ github.ref_name }}-windows
path: dist/win-search-aliases-ui-${{ github.ref_name }}.exe
- uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/win-search-aliases-ui-${{ github.ref_name }}.exe