release-windows-7-x86.yml #1
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
| name: release-windows-7-x86.yml | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-windows-7-x86: | |
| name: Build Windows 7 32-bit | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: i686-pc-windows-msvc | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: './src-tauri -> target' | |
| - name: Install frontend dependencies | |
| run: npm install | |
| - name: Build frontend | |
| run: npm run build | |
| - name: Generate Tauri icons | |
| run: npx tauri icon public/icon.png | |
| continue-on-error: true | |
| - name: Install Tauri Rust dependencies | |
| working-directory: src-tauri | |
| run: cargo fetch | |
| - name: Build Tauri app (Windows x86) | |
| run: npx tauri build --target i686-pc-windows-msvc 2>&1 | |
| timeout-minutes: 30 | |
| - name: List build output | |
| run: | | |
| Get-ChildItem -Path "src-tauri\target\i686-pc-windows-msvc\release\bundle" -Recurse -File -ErrorAction SilentlyContinue | Select-Object FullName | |
| Get-ChildItem -Path "src-tauri\target\i686-pc-windows-msvc\release" -Filter "multimdreader.exe" -ErrorAction SilentlyContinue | Select-Object FullName | |
| continue-on-error: true | |
| - name: Rename artifacts (portable + setup) | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| $tag = ${env:GITHUB_REF_NAME} | |
| $ver = $tag -replace '^v','' | |
| if (-not ($ver -match '^\d+\.\d+\.\d+')) { $ver = '0.1.1' } | |
| $arch = 'x86' | |
| $releaseDir = 'release' | |
| New-Item -ItemType Directory -Force -Path $releaseDir | Out-Null | |
| $targetDir = 'src-tauri\target\i686-pc-windows-msvc\release' | |
| # Portable | |
| Copy-Item "$targetDir\multimdreader.exe" "$releaseDir\multimdreader_${ver}_${arch}-portable-win7.exe" | |
| # Setup (NSIS) | |
| $setup = Get-ChildItem -Path "$targetDir\bundle\nsis" -Filter *.exe -ErrorAction SilentlyContinue | Select-Object -First 1 | |
| if ($setup) { | |
| Copy-Item $setup.FullName "$releaseDir\MultiMDReader_${ver}_${arch}-setup-win7.exe" | |
| } else { | |
| Write-Warning "No NSIS setup found." | |
| } | |
| Get-ChildItem $releaseDir | Select-Object Name | |
| - name: Test Windows 7 compatibility (artifact verification) | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| # Verify executable artifacts exist and have size > 0 | |
| $releaseDir = 'release' | |
| $files = Get-ChildItem -Path $releaseDir -Filter *.exe -ErrorAction SilentlyContinue | |
| if (-not $files -or $files.Length -eq 0) { | |
| Write-Error "No executable artifacts found in $releaseDir. Build may have failed." | |
| } | |
| Write-Host "Found executable artifacts for Windows 7 compatibility:" | |
| $files | ForEach-Object { Write-Host " - $($_.Name) ($($_.Length) bytes)" } | |
| # Verify bootstrapper configuration is present for Windows 7 | |
| $confPath = '.\src-tauri\tauri.conf.json' | |
| if (-not (Test-Path $confPath)) { | |
| Write-Error "tauri.conf.json not found. Cannot verify Windows 7 embedBootstrapper setting." | |
| } | |
| $conf = Get-Content $confPath -Raw | ConvertFrom-Json | |
| $mode = $conf.bundle.windows.webviewInstallMode.type | |
| if ($mode -ne 'embedBootstrapper') { | |
| Write-Error "tauri.conf.json webviewInstallMode is '$mode', expected 'embedBootstrapper' for Windows 7." | |
| } | |
| Write-Host "Windows 7 compatibility check passed: $mode is configured." | |
| # Quick smoke-test: try to launch portable executable briefly (will exit quickly without display) | |
| $portable = $files | Where-Object { $_.Name -like '*portable*' } | Select-Object -First 1 | |
| if ($portable) { | |
| Write-Host "Smoke-testing portable executable ($($portable.Name))..." | |
| try { | |
| Start-Process -FilePath $portable.FullName -ArgumentList '--help' -WindowStyle Hidden -Wait -Timeout 15 -ErrorAction Stop | |
| } catch { | |
| Write-Host "Smoke-test completed (process exited or timed out as expected on headless runner)." | |
| } | |
| } | |
| - name: Upload Windows x86 artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: multimdreader-windows-7-x86 | |
| if-no-files-found: error | |
| path: | | |
| release/multimdreader_*-portable-win7.exe | |
| release/MultiMDReader_*-setup-win7.exe | |
| retention-days: 30 | |
| - name: Create/Update GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| name: 'MultiMDReader ${{ github.ref_name }}' | |
| body: 'See release assets below.' | |
| draft: false | |
| prerelease: false | |
| files: | | |
| release/multimdreader_*-portable-win7.exe | |
| release/MultiMDReader_*-setup-win7.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |