From 532ab0234fac501035eb13e054076151d5f54e73 Mon Sep 17 00:00:00 2001 From: Alvin-Zilverstand <524715@vistacollege.nl> Date: Thu, 10 Sep 2026 14:26:50 +0200 Subject: [PATCH] Add Windows release workflow --- .github/workflows/release.yml | 94 +++++++++++++++++++++++++++++++++++ README.md | 6 +++ package.json | 1 + src-tauri/tauri.conf.json | 9 +++- 4 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..66a6b6f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,94 @@ +name: Build Windows Release + +on: + push: + branches: + - master + - main + tags: + - "v*" + pull_request: + branches: + - master + - main + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: build-windows-release-${{ github.ref }} + cancel-in-progress: true + +jobs: + windows-installer: + name: Windows installer + runs-on: windows-latest + + defaults: + run: + shell: pwsh + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 11.19.0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + workspaces: | + . + src-tauri + + - name: Install Windows bundler dependencies + run: | + choco install nsis wixtoolset -y --no-progress + if (Test-Path "C:\Program Files (x86)\NSIS") { + Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\NSIS" + } + if (Test-Path "C:\Program Files (x86)\WiX Toolset v3.14\bin") { + Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\WiX Toolset v3.14\bin" + } + if (Test-Path "C:\Program Files (x86)\WiX Toolset v3.11\bin") { + Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\WiX Toolset v3.11\bin" + } + + - name: Install frontend dependencies + run: pnpm install --frozen-lockfile + + - name: Run Rust tests + run: cargo test + + - name: Build Windows desktop installers + run: pnpm run desktop:build + + - name: Upload installer artifacts + uses: actions/upload-artifact@v4 + with: + name: clipforge-windows-installers + if-no-files-found: error + path: | + src-tauri/target/release/bundle/msi/*.msi + src-tauri/target/release/bundle/nsis/*.exe + + - name: Publish GitHub release assets + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v2 + with: + files: | + src-tauri/target/release/bundle/msi/*.msi + src-tauri/target/release/bundle/nsis/*.exe diff --git a/README.md b/README.md index 08c7257..a5f825e 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,9 @@ The verified build outputs are: - `src-tauri/target/release/bundle/msi/ClipForge_0.1.0_x64_en-US.msi` - `src-tauri/target/release/bundle/nsis/ClipForge_0.1.0_x64-setup.exe` +The NSIS setup EXE installs for the current Windows user by default and creates the normal Windows uninstaller entry/file during installation. The MSI can also be removed through Windows Apps/Programs and Features. + +## GitHub Releases + +GitHub Actions builds Windows installer artifacts on pushes to `master`/`main`, pull requests, and manual runs. Any pushed file change, including newly added files, triggers a build. Pushing a tag like `v0.1.0` also publishes the MSI and setup EXE to a GitHub Release. + diff --git a/package.json b/package.json index 922070b..d565d9f 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "clipforge", "version": "0.1.0", "private": true, + "packageManager": "pnpm@11.19.0", "type": "module", "description": "Windows-first local game clipping app with replay buffer and event auto-clipping.", "scripts": { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index e133a6f..97b7f8f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -28,7 +28,14 @@ "active": true, "targets": ["msi", "nsis"], "externalBin": ["binaries/ffmpeg"], - "icon": ["icons/icon.ico"] + "icon": ["icons/icon.ico"], + "windows": { + "nsis": { + "installMode": "currentUser", + "installerIcon": "icons/icon.ico", + "uninstallerIcon": "icons/icon.ico" + } + } } }