Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: build

on:
push:
pull_request:
# push:
# pull_request:
jobs:
macos:
strategy:
Expand Down
38 changes: 28 additions & 10 deletions .github/workflows/windows_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Build Windows Release Artifacts
on:
release:
types: [published]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
tag:
Expand All @@ -18,22 +20,29 @@ jobs:
fail-fast: false
matrix:
include:
- target-triple: x86_64-unknown-windows-msvc
product-arch: amd64
# Disabled since the build was always failing
# - target-triple: aarch64-unknown-windows-msvc
# product-arch: arm64
# - target-triple: x86_64-unknown-windows-msvc
# product-arch: amd64
# Disabled since the build was always failing
- target-triple: aarch64-unknown-windows-msvc
product-arch: arm64

steps:
- uses: compnerd/gha-setup-swift@main
with:
tag: 6.1-RELEASE
branch: swift-6.1-release
swift-version: development
# Note: This snapshot includes the WindowsExperimental.sdk needed for static linking support,
# this will be merged into Windows.sdk in the near future and $ExperimentalSDK related flags below will need to be removed
swift-build: DEVELOPMENT-SNAPSHOT-2025-08-27-a
update-sdk-modules: true

- name: Checkout
uses: actions/checkout@v5

- run: swift build -c release --triple ${{ matrix.target-triple }} -Xswiftc -gnone
- shell: pwsh
run: |
$ExperimentalSDK = "$(Split-Path -Path ${env:SDKROOT} -Parent)/WindowsExperimental.sdk"
swift build -c release --triple ${{ matrix.target-triple }} -debug-info-format none -Xswiftc -static-stdlib `
-Xswiftc -sdk -Xswiftc ${ExperimentalSDK}

- uses: microsoft/setup-msbuild@v2.0.0

Expand All @@ -52,10 +61,19 @@ jobs:
throw "Swift redistributable not found at $SwiftRedistDir"
}

# Determine product version based on trigger
if ("${{ github.event_name }}" -eq "release") {
$ProductVersion = "${{ github.event.release.tag_name }}"
} elseif ("${{ github.event_name }}" -eq "workflow_dispatch") {
$ProductVersion = "${{ inputs.tag }}"
} else {
$ProductVersion = "0.0.0.1"
}

& msbuild -nologo -restore Platforms\Windows\SwiftFormat.wixproj `
-p:Configuration=Release `
-p:ProductArchitecture=${{ matrix.product-arch }} `
-p:ProductVersion=${{ github.event.release.tag_name || inputs.tag }} `
-p:ProductVersion=$ProductVersion `
-p:SwiftFormatBuildDir=${{ github.workspace }}\.build\${{ matrix.target-triple }}\release `
-p:SwiftRedistDir=$SwiftRedistDir `
-p:OutputPath=${{ github.workspace }}\artifacts `
Expand All @@ -82,7 +100,7 @@ jobs:
name: Upload release artifacts
runs-on: ubuntu-latest
needs: [build]
if: always()
if: always() && (github.event_name == 'release' || github.event_name == 'workflow_dispatch')
steps:
- name: Checkout the repository
uses: actions/checkout@v5
Expand Down
4 changes: 2 additions & 2 deletions Platforms/Windows/SwiftFormat.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="ManufacturerFolder" Name="nicklockwood">
<Directory Id="INSTALLDIR" Name="SwiftFormat">
<Merge Id="SwiftRuntime" DiskId="1" Language="0" SourceFile="$(SwiftRedistDir)\$(MergeModuleFileName)" />
<!-- <Merge Id="SwiftRuntime" DiskId="1" Language="0" SourceFile="$(SwiftRedistDir)\$(MergeModuleFileName)" /> -->
</Directory>
</Directory>
</StandardDirectory>
Expand All @@ -41,7 +41,7 @@
</ComponentGroup>

<Feature Id="SwiftFormat" Level="1">
<MergeRef Id="SwiftRuntime" />
<!-- <MergeRef Id="SwiftRuntime" /> -->
<ComponentRef Id="swiftformat.exe" />
<ComponentGroupRef Id="EnvironmentVariables" />
</Feature>
Expand Down
Loading