release-windows-x86.yml #2
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-x86.yml | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-windows-x86: | |
| name: Build Windows 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.0.6' } | |
| $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-win.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-win.exe" | |
| } else { | |
| Write-Warning "No NSIS setup found." | |
| } | |
| Get-ChildItem $releaseDir | Select-Object Name | |
| - name: Upload Windows x86 artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: multimdreader-windows-x86 | |
| if-no-files-found: error | |
| path: | | |
| release/multimdreader_*-portable-win.exe | |
| release/MultiMDReader_*-setup-win.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-win.exe | |
| release/MultiMDReader_*-setup-win.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |