44 workflow_dispatch :
55 inputs :
66 version :
7- description : ' Release version'
7+ description : " Release version"
88 required : true
99 type : string
1010 title :
11- description : ' Release title'
11+ description : " Release title"
1212 required : true
1313 type : string
1414
@@ -198,6 +198,88 @@ jobs:
198198 retention-days : 2
199199 if-no-files-found : error
200200
201+ build-windows :
202+ name : Build Windows ${{ matrix.arch-display-name }} Installer
203+ needs : prepare-release
204+ runs-on : windows-${{ matrix.windows-version }}
205+ env :
206+ SWIFT_VERSION : development
207+ SWIFT_BUILD : DEVELOPMENT-SNAPSHOT-2026-01-09-a
208+ strategy :
209+ fail-fast : false
210+ matrix :
211+ include :
212+ - windows-version : 2025
213+ arch-display-name : AMD64
214+ arch : amd64
215+ wix-platform : x64
216+ target-triple : x86_64-unknown-windows-msvc
217+ - windows-version : " 11-arm"
218+ arch-display-name : ARM64
219+ arch : arm64
220+ wix-platform : arm64
221+ target-triple : aarch64-unknown-windows-msvc
222+ permissions :
223+ contents : read
224+ steps :
225+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
226+ with :
227+ ref : ${{ env.RELEASE_BRANCH }}
228+ persist-credentials : false
229+ - name : Set up Swift
230+ uses : compnerd/gha-setup-swift@main
231+ with :
232+ swift-version : ${{ env.SWIFT_VERSION }}
233+ swift-build : ${{ env.SWIFT_BUILD }}
234+ build_arch : ${{ matrix.arch }}
235+ - name : Build static executable
236+ shell : pwsh
237+ run : |
238+ $sdk = Join-Path (Split-Path -Path $env:SDKROOT -Parent) 'WindowsExperimental.sdk'
239+ swift build `
240+ -c release `
241+ --product swiftlint `
242+ --triple ${{ matrix.target-triple }} `
243+ -debug-info-format none `
244+ -Xswiftc -static-stdlib `
245+ -Xswiftc -sdk `
246+ -Xswiftc $sdk `
247+ -Xlinker /NODEFAULTLIB:curl -Xlinker libcurl.lib `
248+ -Xlinker /NODEFAULTLIB:xml2 -Xlinker libxml2s.lib `
249+ -Xlinker zlibstatic.lib `
250+ -Xlinker brotlidec.lib `
251+ -Xlinker brotlicommon.lib
252+ - name : Prepare artifacts directory
253+ shell : pwsh
254+ run : |
255+ New-Item -ItemType Directory -Path artifacts -Force | Out-Null
256+ Copy-Item ".build/${{ matrix.target-triple }}/release/swiftlint.exe" "artifacts/swiftlint.exe" -Force
257+ - name : Create portable zip
258+ shell : pwsh
259+ run : |
260+ Compress-Archive -Path "artifacts/swiftlint.exe" -DestinationPath "artifacts/SwiftLint.${{ matrix.arch }}.zip" -Force
261+ - name : Setup MSBuild
262+ uses : microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
263+ - name : Build WiX MSI
264+ shell : pwsh
265+ run : |
266+ & msbuild -nologo `
267+ Platforms\Windows\SwiftLint.wixproj `
268+ -p:Configuration=Release `
269+ -p:InstallerPlatform=${{ matrix.wix-platform }} `
270+ -p:ProductVersion=${{ inputs.version }} `
271+ -p:SwiftLintBuildDir=${{ github.workspace }}\.build\${{ matrix.target-triple }}\release `
272+ -p:OutputPath=${{ github.workspace }}\artifacts `
273+ -p:RunWixToolsOutOfProc=true
274+ Move-Item -Path "artifacts\SwiftLint.msi" -Destination "artifacts\SwiftLint.${{ matrix.arch }}.msi" -Force
275+ - name : Upload artifacts
276+ uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
277+ with :
278+ name : swiftlint-windows-${{ matrix.arch }}
279+ path : artifacts
280+ retention-days : 2
281+ if-no-files-found : error
282+
201283 create-release :
202284 name : Create Release
203285 needs :
@@ -206,6 +288,7 @@ jobs:
206288 - build-linux
207289 - build-static-linux
208290 - build-macos
291+ - build-windows
209292 runs-on : macOS-26
210293 permissions :
211294 actions : read
@@ -223,17 +306,23 @@ jobs:
223306 uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
224307 - name : Move artifacts
225308 run : |
309+ # Move macOS artifacts.
226310 mv -f swiftlint-macos/* .
311+
312+ # Move Linux artifacts.
227313 mv -f swiftlint-linux-amd64/swiftlint swiftlint_linux_amd64
228314 mv -f swiftlint-linux-arm64/swiftlint swiftlint_linux_arm64
229315 mv -f swiftlint-static-amd64/swiftlint swiftlint_static_amd64
230316 mv -f swiftlint-static-arm64/swiftlint swiftlint_static_arm64
231317
232318 # Just pick one of the licenses.
233319 mv -f swiftlint-static-amd64/LICENSE.mimalloc .
320+
321+ # Move Windows artifacts.
322+ mv -f swiftlint-windows-{arm,amd}64/*.{msi,zip} .
234323 - name : Make binaries executable
235324 run : chmod +x swiftlint*
236- - name : Create artifacts
325+ - name : Package artifacts
237326 run : |
238327 make --debug spm_artifactbundle
239328 make --debug package
0 commit comments