Windows Build #1
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
| name: Windows Build | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| ml_version: | |
| description: 'Mintlayer release version (e.g. 1.3.0)' | |
| required: false | |
| default: '1.3.0' | |
| env: | |
| ML_VERSION: ${{ github.event.inputs.ml_version || '1.3.0' }} | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # ── Node / Astro build ────────────────────────────────────────────────── | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: app/package-lock.json | |
| - name: Build Astro app | |
| working-directory: app | |
| run: | | |
| npm ci | |
| npm run build | |
| # ── Bun compile → web-gui.exe ─────────────────────────────────────────── | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Compile web-gui.exe | |
| run: | | |
| bun build --compile --minify ` | |
| --outfile windows/src-tauri/binaries/web-gui-x86_64-pc-windows-msvc.exe ` | |
| app/dist/server/entry.mjs | |
| # ── Mintlayer Windows binaries ────────────────────────────────────────── | |
| - name: Download Mintlayer Windows binaries | |
| shell: pwsh | |
| run: | | |
| $url = "https://github.com/mintlayer/mintlayer-core/releases/download/v$env:ML_VERSION/Mintlayer_Node_win_$env:ML_VERSION.zip" | |
| Invoke-WebRequest -Uri $url -OutFile ml_win.zip | |
| Expand-Archive -Path ml_win.zip -DestinationPath ml_win | |
| $srcDir = "ml_win\Mintlayer_Node_win_$env:ML_VERSION" | |
| $dstDir = "windows\src-tauri\binaries" | |
| New-Item -ItemType Directory -Force -Path $dstDir | Out-Null | |
| $exes = @("node-daemon", "wallet-rpc-daemon", "api-blockchain-scanner-daemon", "api-web-server") | |
| foreach ($exe in $exes) { | |
| Copy-Item "$srcDir\$exe.exe" "$dstDir\$exe-x86_64-pc-windows-msvc.exe" | |
| Write-Host "Copied $exe.exe" | |
| } | |
| # ── wasm-wrappers ─────────────────────────────────────────────────────── | |
| - name: Copy wasm-wrappers | |
| shell: pwsh | |
| run: | | |
| Copy-Item -Recurse app/wasm-wrappers windows/src-tauri/binaries/wasm-wrappers | |
| # ── PostgreSQL portable ───────────────────────────────────────────────── | |
| - name: Cache PostgreSQL portable | |
| id: cache-postgres | |
| uses: actions/cache@v4 | |
| with: | |
| path: windows/src-tauri/binaries/postgres | |
| key: postgres-17.4-1-windows-x64 | |
| - name: Download PostgreSQL portable | |
| if: steps.cache-postgres.outputs.cache-hit != 'true' | |
| shell: pwsh | |
| run: | | |
| $url = "https://get.enterprisedb.com/postgresql/postgresql-17.4-1-windows-x64-binaries.zip" | |
| Invoke-WebRequest -Uri $url -OutFile pg.zip | |
| Write-Host "Extracting PostgreSQL..." | |
| Expand-Archive -Path pg.zip -DestinationPath pg_extract | |
| $dst = "windows\src-tauri\binaries\postgres" | |
| New-Item -ItemType Directory -Force -Path $dst | Out-Null | |
| Copy-Item -Recurse pg_extract\pgsql\bin $dst\bin | |
| Copy-Item -Recurse pg_extract\pgsql\lib $dst\lib | |
| Copy-Item -Recurse pg_extract\pgsql\share $dst\share | |
| # ── Rust / Tauri ──────────────────────────────────────────────────────── | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-pc-windows-msvc | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: windows/src-tauri | |
| - name: Install cargo-tauri | |
| run: cargo install tauri-cli --version "^2" --locked | |
| - name: Build Tauri installer | |
| working-directory: windows | |
| run: cargo tauri build --target x86_64-pc-windows-msvc | |
| # ── Upload artifacts ──────────────────────────────────────────────────── | |
| - name: Upload MSI installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mintlayer-gui-windows-x64 | |
| path: | | |
| windows/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi | |
| windows/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe | |
| retention-days: 30 | |
| # ── Attach to GitHub Release (on tag push) ────────────────────────────── | |
| - name: Upload to GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| windows/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi | |
| windows/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe |