Skip to content

Commit 0c3b94a

Browse files
committed
ci: add Windows build workflow and include in releases
- Add build-windows.yml for Windows x86_64 builds - Produces MSI and NSIS exe installers - Update release.yml to include Windows in release artifacts - Update release notes to mention Windows downloads Addresses community requests for Windows builds (winfunc#301, winfunc#332, winfunc#370)
1 parent 68aef95 commit 0c3b94a

2 files changed

Lines changed: 77 additions & 1 deletion

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build Windows
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
name: Build Windows x86_64
12+
runs-on: windows-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup Rust
18+
uses: dtolnay/rust-toolchain@stable
19+
with:
20+
targets: x86_64-pc-windows-msvc
21+
22+
- name: Setup Rust cache
23+
uses: Swatinem/rust-cache@v2
24+
with:
25+
workspaces: src-tauri
26+
27+
- name: Setup Bun
28+
uses: oven-sh/setup-bun@v2
29+
30+
- name: Install dependencies
31+
run: bun install
32+
33+
- name: Build Tauri app
34+
run: bun run tauri build --target x86_64-pc-windows-msvc
35+
36+
- name: Create artifacts directory
37+
shell: pwsh
38+
run: |
39+
New-Item -ItemType Directory -Force -Path dist/windows-x86_64
40+
41+
# Copy MSI installer
42+
$msiFiles = Get-ChildItem -Path "src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi" -ErrorAction SilentlyContinue
43+
if ($msiFiles) {
44+
Copy-Item $msiFiles.FullName -Destination "dist/windows-x86_64/"
45+
}
46+
47+
# Copy NSIS installer
48+
$nsisFiles = Get-ChildItem -Path "src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe" -ErrorAction SilentlyContinue
49+
if ($nsisFiles) {
50+
Copy-Item $nsisFiles.FullName -Destination "dist/windows-x86_64/"
51+
}
52+
53+
# Generate checksums
54+
Set-Location dist/windows-x86_64
55+
Get-ChildItem -File | ForEach-Object {
56+
$hash = (Get-FileHash $_.Name -Algorithm SHA256).Hash.ToLower()
57+
"$hash $($_.Name)" | Out-File -Append -FilePath checksums.txt -Encoding utf8
58+
}
59+
60+
- name: Upload artifacts
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: windows-x86_64
64+
path: dist/windows-x86_64/*
65+
if-no-files-found: error

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ jobs:
2424
uses: ./.github/workflows/build-macos.yml
2525
secrets: inherit
2626

27+
build-windows:
28+
uses: ./.github/workflows/build-windows.yml
29+
secrets: inherit
2730

2831
# Create release after all builds complete
2932
create-release:
3033
name: Create Release
31-
needs: [build-linux, build-macos]
34+
needs: [build-linux, build-macos, build-windows]
3235
runs-on: ubuntu-latest
3336

3437
steps:
@@ -66,6 +69,12 @@ jobs:
6669
cp artifacts/macos-universal/opcode.app.zip release-assets/opcode_${{ steps.version.outputs.version }}_macos_universal.app.tar.gz || true
6770
fi
6871
72+
# Windows artifacts
73+
if [ -d "artifacts/windows-x86_64" ]; then
74+
cp artifacts/windows-x86_64/*.msi release-assets/opcode_${{ steps.version.outputs.version }}_windows_x86_64.msi || true
75+
cp artifacts/windows-x86_64/*.exe release-assets/opcode_${{ steps.version.outputs.version }}_windows_x86_64_setup.exe || true
76+
fi
77+
6978
# Create source code archives
7079
# Clean version without 'v' prefix for archive names
7180
CLEAN_VERSION="${{ steps.version.outputs.version }}"
@@ -112,9 +121,11 @@ jobs:
112121
113122
- macOS: `.dmg`, `.app.tar.gz` (Universal: Apple Silicon + Intel)
114123
- Linux: `.AppImage`, `.deb`
124+
- Windows: `.msi`, `.exe` installer
115125
116126
### Installation
117127
118128
- macOS: Open the `.dmg` and drag opcode to Applications.
119129
- Linux: `chmod +x` the `.AppImage` and run it, or install the `.deb` on Debian/Ubuntu.
130+
- Windows: Run the `.msi` or `.exe` installer.
120131

0 commit comments

Comments
 (0)