@@ -19,23 +19,37 @@ export async function run(): Promise<void> {
19
19
try {
20
20
const version : string = core . getInput ( 'version' )
21
21
22
- // Fail the workflow run if we're not running on macOS
23
- if ( process . platform !== 'darwin' ) {
24
- core . setFailed (
25
- `Unsupported OS "${ process . platform } , only "darwin" is currently supported`
26
- )
27
-
28
- return
29
- }
30
-
31
22
// Determine the asset URL
32
23
let url : string
33
24
34
25
if ( version !== 'latest' ) {
35
- url = `https://github.com/realm/SwiftLint/releases/download/${ version } /portable_swiftlint.zip `
26
+ url = `https://github.com/realm/SwiftLint/releases/download/${ version } /`
36
27
} else {
37
- url =
38
- 'https://github.com/realm/SwiftLint/releases/latest/download/portable_swiftlint.zip'
28
+ url = 'https://github.com/realm/SwiftLint/releases/latest/download/'
29
+ }
30
+
31
+ if ( process . platform === 'darwin' ) {
32
+ // SwiftLint's binaries for Darwin are universal
33
+ url += 'portable_swiftlint.zip'
34
+ } else if ( process . platform === 'linux' ) {
35
+ // SwiftLint's binaries for Linux are x64-only[1]
36
+ //
37
+ // [1]: https://github.com/realm/SwiftLint/issues/4531
38
+ if ( process . arch === 'x64' ) {
39
+ core . setFailed (
40
+ `Unsupported Linux architecture "${ process . arch } ", only "x64" is currently supported`
41
+ )
42
+
43
+ return
44
+ }
45
+
46
+ url += 'swiftlint_linux.zip'
47
+ } else {
48
+ core . setFailed (
49
+ `Unsupported OS "${ process . platform } ", only "darwin" and "linux" are currently supported`
50
+ )
51
+
52
+ return
39
53
}
40
54
41
55
// Retrieve the SwiftLint binary from the tool cache
0 commit comments