chore: bump version to v0.4.6 #22
Workflow file for this run
This file contains hidden or 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
| # GitHub Actions Release Workflow | |
| # Create release when tag is pushed | |
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-and-release: | |
| name: Build and Release | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install "numpy>=1.24.0,<2.0.0" --only-binary=:all: | |
| pip install -r requirements.txt --verbose | |
| echo "=== Installed packages ===" | |
| pip list | |
| shell: pwsh | |
| - name: Verify dependencies | |
| run: | | |
| python -c "import aioesphomeapi; print(f'aioesphomeapi version: {aioesphomeapi.__version__}')" | |
| python -c "import customtkinter; print('customtkinter OK')" | |
| python -c "import pymicro_wakeword; print('pymicro_wakeword OK')" | |
| - name: Build Single-File EXE | |
| run: | | |
| python setup.py --build | |
| - name: Build Directory Mode for Installer | |
| run: | | |
| python setup.py --build-dir | |
| - name: Install NSIS | |
| run: | | |
| # Use winget (Windows Package Manager) to install NSIS | |
| Write-Host "Installing NSIS using winget..." | |
| # Try to install NSIS using winget | |
| winget install --id NSIS.NSIS --exact --accept-source-agreements --accept-package-agreements -e --silent | |
| # Wait for installation to complete | |
| Start-Sleep -Seconds 10 | |
| # Verify installation | |
| $nsisPaths = @( | |
| "C:\Program Files (x86)\NSIS\makensis.exe", | |
| "C:\Program Files\NSIS\makensis.exe", | |
| "C:\NSIS\makensis.exe" | |
| ) | |
| $makensis = $null | |
| foreach ($path in $nsisPaths) { | |
| if (Test-Path $path) { | |
| $makensis = $path | |
| Write-Host "NSIS installed successfully at: $makensis" | |
| break | |
| } | |
| } | |
| if (-not $makensis) { | |
| # Fallback: try to find makensis.exe in Program Files | |
| $found = Get-ChildItem -Path "C:\Program Files" -Recurse -Filter "makensis.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 | |
| if ($found) { | |
| $makensis = $found.FullName | |
| Write-Host "Found NSIS at: $makensis" | |
| } | |
| } | |
| if (-not $makensis) { | |
| Write-Error "NSIS installation failed - makensis.exe not found" | |
| exit 1 | |
| } | |
| shell: pwsh | |
| - name: Build NSIS Installer | |
| run: | | |
| # Create installer directory | |
| New-Item -ItemType Directory -Force -Path "installer" | Out-Null | |
| # Find NSIS makensis.exe | |
| $nsisPaths = @( | |
| "C:\Program Files (x86)\NSIS\makensis.exe", | |
| "C:\Program Files\NSIS\makensis.exe", | |
| "C:\NSIS\makensis.exe" | |
| ) | |
| $makensis = $null | |
| foreach ($path in $nsisPaths) { | |
| if (Test-Path $path) { | |
| $makensis = $path | |
| Write-Host "Found NSIS at: $makensis" | |
| break | |
| } | |
| } | |
| if (-not $makensis) { | |
| Write-Error "NSIS makensis.exe not found" | |
| exit 1 | |
| } | |
| # Build NSIS installer | |
| & $makensis "installer\installer.nsi" | |
| if ($LASTEXITCODE -eq 0) { | |
| Write-Host "Installer built successfully!" | |
| if (Test-Path "dist\HomeAssistantWindows_Setup.exe") { | |
| $file = Get-Item dist\HomeAssistantWindows_Setup.exe | |
| Write-Host "Size: $([math]::Round($file.Length / 1MB, 2)) MB" | |
| } | |
| } else { | |
| Write-Error "Installer build failed!" | |
| exit 1 | |
| } | |
| shell: pwsh | |
| - name: Check build output | |
| run: | | |
| if (Test-Path "dist\HomeAssistantWindows.exe") { | |
| Write-Host "EXE file built successfully!" | |
| $file = Get-Item dist\HomeAssistantWindows.exe | |
| Write-Host "Size: $([math]::Round($file.Length / 1MB, 2)) MB" | |
| Write-Host "LastWriteTime: $($file.LastWriteTime)" | |
| } else { | |
| Write-Host "EXE file build failed!" | |
| exit 1 | |
| } | |
| if (Test-Path "dist\HomeAssistantWindows_Setup.exe") { | |
| Write-Host "Installer built successfully!" | |
| $file = Get-Item dist\HomeAssistantWindows_Setup.exe | |
| Write-Host "Size: $([math]::Round($file.Length / 1MB, 2)) MB" | |
| } else { | |
| Write-Host "Warning: Installer not found, skipping..." | |
| } | |
| shell: pwsh | |
| - name: Generate latest.json | |
| run: | | |
| $tag = "${{ github.ref_name }}" | |
| $version = $tag -replace '^v', '' | |
| $json = @{version = $version} | ConvertTo-Json | |
| $json | Out-File -FilePath "dist\latest.json" -Encoding utf8 | |
| Write-Host "Generated latest.json with version: $version" | |
| Get-Content "dist\latest.json" | |
| shell: pwsh | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| dist/HomeAssistantWindows.exe | |
| dist/HomeAssistantWindows_Setup.exe | |
| dist/latest.json | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |