@@ -119,6 +119,41 @@ jobs:
119
119
name : ${{ matrix.artifact_name }}
120
120
path : .build/release/swiftlint
121
121
122
+ build-static-linux :
123
+ name : Build Static Linux ${{ matrix.arch }} Binary
124
+ runs-on : ${{ matrix.runner }}
125
+ strategy :
126
+ fail-fast : false
127
+ matrix :
128
+ include :
129
+ - arch : ARM64
130
+ runner : ubuntu-24.04-arm
131
+ swift_sdk : aarch64-swift-linux-musl
132
+ artifact_name : swiftlint-static-arm64
133
+ - arch : AMD64
134
+ runner : ubuntu-24.04
135
+ swift_sdk : x86_64-swift-linux-musl
136
+ artifact_name : swiftlint-static-amd64
137
+ permissions :
138
+ contents : read
139
+ env :
140
+ BINARY_PATH : .build/${{ matrix.swift_sdk }}/release/swiftlint
141
+ steps :
142
+ - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
143
+ with :
144
+ persist-credentials : false
145
+ - name : Install SDK
146
+ run : swift sdk install https://download.swift.org/swift-6.1.2-release/static-sdk/swift-6.1.2-RELEASE/swift-6.1.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum df0b40b9b582598e7e3d70c82ab503fd6fbfdff71fd17e7f1ab37115a0665b3b
147
+ - name : Build static binary
148
+ run : swift build -c release --product swiftlint --swift-sdk ${{ matrix.swift_sdk }} -Xswiftc -DSWIFTLINT_DISABLE_SOURCEKIT
149
+ - name : Strip binary
150
+ run : strip -s "$BINARY_PATH"
151
+ - name : Upload artifact
152
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
153
+ with :
154
+ name : ${{ matrix.artifact_name }}
155
+ path : ${{ env.BINARY_PATH }}
156
+
122
157
build-macos :
123
158
name : Build macOS Binaries
124
159
needs : prepare-release
@@ -149,6 +184,7 @@ jobs:
149
184
- setup-credentials
150
185
- prepare-release
151
186
- build-linux
187
+ - build-static-linux
152
188
- build-macos
153
189
runs-on : macOS-14
154
190
permissions :
@@ -173,8 +209,10 @@ jobs:
173
209
mv -f swiftlint-macos/bazel.* .
174
210
mv -f swiftlint-linux-amd64/swiftlint ${{ env.LINUX_BUILD_DIR }}/swiftlint_linux_amd64
175
211
mv -f swiftlint-linux-arm64/swiftlint ${{ env.LINUX_BUILD_DIR }}/swiftlint_linux_arm64
212
+ mv -f swiftlint-static-amd64/swiftlint ${{ env.LINUX_BUILD_DIR }}/swiftlint_static_amd64
213
+ mv -f swiftlint-static-arm64/swiftlint ${{ env.LINUX_BUILD_DIR }}/swiftlint_static_arm64
176
214
- name : Make binaries executable
177
- run : chmod +x ${{ env.MACOS_BUILD_DIR }}/swiftlint ${{ env.LINUX_BUILD_DIR }}/swiftlint_linux_*
215
+ run : chmod +x ${{ env.MACOS_BUILD_DIR }}/swiftlint ${{ env.LINUX_BUILD_DIR }}/swiftlint_linux_* ${{ env.LINUX_BUILD_DIR }}/swiftlint_static_*
178
216
- name : Create artifacts
179
217
run : |
180
218
make --debug spm_artifactbundle
0 commit comments