Skip to content

Commit a8f4ecb

Browse files
authored
Merge pull request #1801 from shibayan/windows-arm
Support Windows Arm64 Build
2 parents 5e8339b + 3c07746 commit a8f4ecb

File tree

2 files changed

+88
-29
lines changed

2 files changed

+88
-29
lines changed

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,43 @@ jobs:
100100
name: windows-zip
101101
path: target/release/volta-windows.zip
102102

103+
windows-arm:
104+
name: Build - Windows ARM
105+
runs-on: windows-latest
106+
steps:
107+
- name: Check out code
108+
uses: actions/checkout@v4
109+
- name: Set up cargo
110+
uses: actions-rust-lang/setup-rust-toolchain@v1
111+
with:
112+
target: aarch64-pc-windows-msvc
113+
- name: Add cargo-wix subcommand
114+
run: cargo install cargo-wix
115+
- name: Compile and package installer
116+
run: |
117+
cargo wix --nocapture --package volta --target aarch64-pc-windows-msvc --output target\wix\volta-windows-arm.msi
118+
- name: Create zip of binaries
119+
run: powershell Compress-Archive volta*.exe volta-windows-arm.zip
120+
working-directory: ./target/aarch64-pc-windows-msvc/release
121+
- name: Upload installer
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: windows-installer-arm
125+
path: target/wix/volta-windows-arm.msi
126+
- name: Upload zip
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: windows-zip-arm
130+
path: target/aarch64-pc-windows-msvc/release/volta-windows-arm.zip
131+
103132
release:
104133
name: Publish release
105134
runs-on: ubuntu-latest
106135
needs:
107136
- linux
108137
- macos
109138
- windows
139+
- windows-arm
110140
if: github.event_name == 'push'
111141
steps:
112142
- name: Check out code
@@ -141,6 +171,16 @@ jobs:
141171
with:
142172
name: windows-zip
143173
path: release
174+
- name: Fetch Windows ARM installer
175+
uses: actions/download-artifact@v4
176+
with:
177+
name: windows-installer-arm
178+
path: release
179+
- name: Fetch Windows ARM zip
180+
uses: actions/download-artifact@v4
181+
with:
182+
name: windows-zip-arm
183+
path: release
144184
- name: Show release artifacts
145185
run: ls -la release
146186
- name: Create draft release
@@ -197,6 +237,24 @@ jobs:
197237
asset_path: ./release/volta-windows.zip
198238
asset_name: volta-${{ steps.release_info.outputs.version }}-windows.zip
199239
asset_content_type: application/zip
240+
- name: Upload Windows ARM installer
241+
uses: actions/upload-release-asset@v1
242+
env:
243+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
244+
with:
245+
upload_url: ${{ steps.create_release.outputs.upload_url }}
246+
asset_path: ./release/volta-windows-arm.msi
247+
asset_name: volta-${{ steps.release_info.outputs.version }}-windows-arm64.msi
248+
asset_content_type: application/x-msi
249+
- name: Upload Windows ARM zip
250+
uses: actions/upload-release-asset@v1
251+
env:
252+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
253+
with:
254+
upload_url: ${{ steps.create_release.outputs.upload_url }}
255+
asset_path: ./release/volta-windows-arm.zip
256+
asset_name: volta-${{ steps.release_info.outputs.version }}-windows-arm64.zip
257+
asset_content_type: application/zip
200258
- name: Upload manifest file
201259
uses: actions/upload-release-asset@v1
202260
env:

wix/main.wxs

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121
destination for 32-bit versus 64-bit installers. Removal of these lines will
2222
cause installation errors.
2323
-->
24-
<?if $(var.Platform) = x64 ?>
25-
<?define Win64 = "yes" ?>
24+
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
2625
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
2726
<?else ?>
28-
<?define Win64 = "no" ?>
2927
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
3028
<?endif ?>
3129

@@ -44,12 +42,11 @@
4442
Keywords='Installer'
4543
Description='The JavaScript Launcher'
4644
Manufacturer='The Volta Maintainers'
47-
InstallerVersion='450'
45+
InstallerVersion='500'
4846
Languages='1033'
4947
Compressed='yes'
5048
InstallScope='perMachine'
51-
SummaryCodepage='1252'
52-
Platform='$(var.Platform)'/>
49+
SummaryCodepage='1252'/>
5350

5451
<MajorUpgrade
5552
Schedule='afterInstallInitialize'
@@ -62,16 +59,18 @@
6259
<Directory Id='INSTALLDIR' Name='Volta'>
6360
</Directory>
6461
</Directory>
62+
<?if $(sys.BUILDARCH) = x64 ?>
6563
<Merge Id='VCRedist' SourceFile='wix\Microsoft_VC140_CRT_x64.msm' DiskId='1' Language='0'/>
64+
<?endif ?>
6665
</Directory>
6766

6867
<ComponentGroup Id='Binaries' Directory='INSTALLDIR'>
69-
<Component Id='voltaBinary' Guid='*' Win64='$(var.Win64)'>
68+
<Component Id='voltaBinary' Guid='*'>
7069
<File
7170
Id='voltaEXE'
7271
Name='volta.exe'
7372
DiskId='1'
74-
Source='target\release\volta.exe'
73+
Source='$(var.CargoTargetBinDir)\volta.exe'
7574
KeyPath='yes'/>
7675
<Environment
7776
Id='INSTALLPATH'
@@ -82,103 +81,103 @@
8281
Action='set'
8382
System='yes' />
8483
</Component>
85-
<Component Id='shimBinary' Guid='*' Win64='$(var.Win64)'>
84+
<Component Id='shimBinary' Guid='*'>
8685
<File
8786
Id='voltashimEXE'
8887
Name='volta-shim.exe'
8988
DiskId='1'
90-
Source='target\release\volta-shim.exe'
89+
Source='$(var.CargoTargetBinDir)\volta-shim.exe'
9190
KeyPath='yes'/>
9291
</Component>
93-
<Component Id='migrateBinary' Guid='*' Win64='$(var.Win64)'>
92+
<Component Id='migrateBinary' Guid='*'>
9493
<File
9594
Id='voltamigrateEXE'
9695
Name='volta-migrate.exe'
9796
DiskId='1'
98-
Source='target\release\volta-migrate.exe'
97+
Source='$(var.CargoTargetBinDir)\volta-migrate.exe'
9998
KeyPath='yes'/>
10099
</Component>
101-
<Component Id='nodeBinary' Guid='*' Win64='$(var.Win64)'>
100+
<Component Id='nodeBinary' Guid='*'>
102101
<File
103102
Id='nodeEXE'
104103
Name='node.exe'
105104
DiskId='1'
106-
Source='target\release\volta-shim.exe'
105+
Source='$(var.CargoTargetBinDir)\volta-shim.exe'
107106
KeyPath='yes'/>
108107
</Component>
109-
<Component Id='npmBinary' Guid='*' Win64='$(var.Win64)'>
108+
<Component Id='npmBinary' Guid='*'>
110109
<File
111110
Id='npmEXE'
112111
Name='npm.exe'
113112
DiskId='1'
114-
Source='target\release\volta-shim.exe'
113+
Source='$(var.CargoTargetBinDir)\volta-shim.exe'
115114
KeyPath='yes'/>
116115
</Component>
117-
<Component Id='npmScript' Guid='*' Win64='$(var.Win64)'>
116+
<Component Id='npmScript' Guid='*'>
118117
<File
119118
Id='npmCMD'
120119
Name='npm.cmd'
121120
DiskId='1'
122121
Source='wix\shim.cmd'
123122
KeyPath='yes'/>
124123
</Component>
125-
<Component Id='npxBinary' Guid='*' Win64='$(var.Win64)'>
124+
<Component Id='npxBinary' Guid='*'>
126125
<File
127126
Id='npxEXE'
128127
Name='npx.exe'
129128
DiskId='1'
130-
Source='target\release\volta-shim.exe'
129+
Source='$(var.CargoTargetBinDir)\volta-shim.exe'
131130
KeyPath='yes'/>
132131
</Component>
133-
<Component Id='npxScript' Guid='*' Win64='$(var.Win64)'>
132+
<Component Id='npxScript' Guid='*'>
134133
<File
135134
Id='npxCMD'
136135
Name='npx.cmd'
137136
DiskId='1'
138137
Source='wix\shim.cmd'
139138
KeyPath='yes'/>
140139
</Component>
141-
<Component Id='pnpmBinary' Guid='*' Win64='$(var.Win64)'>
140+
<Component Id='pnpmBinary' Guid='*'>
142141
<File
143142
Id='pnpmEXE'
144143
Name='pnpm.exe'
145144
DiskId='1'
146-
Source='target\release\volta-shim.exe'
145+
Source='$(var.CargoTargetBinDir)\volta-shim.exe'
147146
KeyPath='yes'/>
148147
</Component>
149-
<Component Id='pnpmScript' Guid='*' Win64='$(var.Win64)'>
148+
<Component Id='pnpmScript' Guid='*'>
150149
<File
151150
Id='pnpmCMD'
152151
Name='pnpm.cmd'
153152
DiskId='1'
154153
Source='wix\shim.cmd'
155154
KeyPath='yes'/>
156155
</Component>
157-
<Component Id='yarnBinary' Guid='*' Win64='$(var.Win64)'>
156+
<Component Id='yarnBinary' Guid='*'>
158157
<File
159158
Id='yarnEXE'
160159
Name='yarn.exe'
161160
DiskId='1'
162-
Source='target\release\volta-shim.exe'
161+
Source='$(var.CargoTargetBinDir)\volta-shim.exe'
163162
KeyPath='yes'/>
164163
</Component>
165-
<Component Id='yarnScript' Guid='*' Win64='$(var.Win64)'>
164+
<Component Id='yarnScript' Guid='*'>
166165
<File
167166
Id='yarnCMD'
168167
Name='yarn.cmd'
169168
DiskId='1'
170169
Source='wix\shim.cmd'
171170
KeyPath='yes'/>
172171
</Component>
173-
<Component Id='yarnPkgBinary' Guid='*' Win64='$(var.Win64)'>
172+
<Component Id='yarnPkgBinary' Guid='*'>
174173
<File
175174
Id='yarnpgkEXE'
176175
Name='yarnpkg.exe'
177176
DiskId='1'
178-
Source='target\release\volta-shim.exe'
177+
Source='$(var.CargoTargetBinDir)\volta-shim.exe'
179178
KeyPath='yes'/>
180179
</Component>
181-
<Component Id='yarnPkgScript' Guid='*' Win64='$(var.Win64)'>
180+
<Component Id='yarnPkgScript' Guid='*'>
182181
<File
183182
Id='yarnpkgCMD'
184183
Name='yarnpkg.cmd'
@@ -192,9 +191,11 @@
192191
<ComponentGroupRef Id='Binaries'/>
193192
</Feature>
194193

194+
<?if $(sys.BUILDARCH) = x64 ?>
195195
<Feature Id='VCRedistributable' Title='Visual C++ Runtime' AllowAdvertise='no' Display='hidden' Level='1'>
196196
<MergeRef Id='VCRedist'/>
197197
</Feature>
198+
<?endif ?>
198199

199200
<SetProperty Id='ARPINSTALLLOCATION' Value='[APPLICATIONFOLDER]' After='CostFinalize'/>
200201

0 commit comments

Comments
 (0)