Skip to content

Commit cb513a1

Browse files
committed
wip windows cross install
1 parent 0526294 commit cb513a1

File tree

3 files changed

+704
-542
lines changed

3 files changed

+704
-542
lines changed

.github/workflows/rust.yml

+53-9
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,14 @@ jobs:
161161
path: packages/notedeck-${{ matrix.arch }}.dmg
162162

163163
windows-installer:
164-
name: Build Windows Installer
164+
name: Windows Installer
165165
runs-on: windows-latest
166166
needs: windows-test
167-
if: github.ref_name == 'master'
167+
strategy:
168+
fail-fast: false
169+
matrix:
170+
arch: [x86_64, aarch64]
171+
168172
steps:
169173
# Checkout the repository
170174
- name: Checkout Code
@@ -178,19 +182,59 @@ jobs:
178182
- name: Install Inno Setup
179183
run: choco install innosetup --no-progress --yes
180184

185+
# Set up Rust toolchain
186+
- name: Install Rust toolchain
187+
run: rustup target add ${{ matrix.arch }}-pc-windows-msvc
188+
189+
# Build
190+
- name: Build
191+
shell: pwsh
192+
run: |
193+
$target = "${{ matrix.arch }}-pc-windows-msvc"
194+
Write-Output "Building for target: $target"
195+
cargo build --release --target=$target
196+
197+
# Generate ISS Script
198+
- name: Generate Inno Setup Script
199+
shell: pwsh
200+
run: |
201+
$arch = "${{ matrix.arch }}"
202+
$issContent = @"
203+
[Setup]
204+
AppName=Damus Notedeck
205+
AppVersion=0.1
206+
DefaultDirName={pf}\Notedeck
207+
DefaultGroupName=Damus Notedeck
208+
OutputDir=..\packages\$arch
209+
OutputBaseFilename=DamusNotedeckInstaller
210+
Compression=lzma
211+
SolidCompression=yes
212+
213+
[Files]
214+
Source: "..\target\$arch-pc-windows-msvc\release\notedeck.exe"; DestDir: "{app}"; Flags: ignoreversion
215+
216+
[Icons]
217+
Name: "{group}\Damus Notedeck"; Filename: "{app}\notedeck.exe"
218+
219+
[Run]
220+
Filename: "{app}\notedeck.exe"; Description: "Launch Damus Notedeck"; Flags: nowait postinstall skipifsilent
221+
"@
222+
Set-Content -Path "scripts/windows-installer-$arch.iss" -Value $issContent
223+
181224
# Build Installer
182225
- name: Run Inno Setup Script
183226
run: |
184-
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "scripts\windows-installer.iss"
185-
186-
# List outputs
187-
- name: List Inno Script outputs
188-
run: dir packages
227+
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "scripts\windows-installer-${{ matrix.arch }}.iss"
189228
229+
# Move output
230+
- name: Move Inno Script outputs to architecture-specific folder
231+
run: |
232+
New-Item -ItemType Directory -Force -Path packages\${{ matrix.arch }}
233+
Move-Item -Path packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe -Destination packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe
190234
# Upload the installer as an artifact
191235
- name: Upload Installer
192236
uses: actions/upload-artifact@v4
193237
with:
194-
name: DamusNotedeckInstaller.exe
195-
path: packages\DamusNotedeckInstaller.exe
238+
name: DamusNotedeckInstaller-${{ matrix.arch }}.exe
239+
path: packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe
196240

0 commit comments

Comments
 (0)