Skip to content

Commit 6ad29be

Browse files
authored
ci: added custom swiftorg website commit testing (#390)
* ci: added custom swiftorg website commit testing * fix: added swift 6.x gpg recovery key
1 parent d4a0311 commit 6ad29be

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- cron: '0 0 * * *'
99
workflow_dispatch:
1010
inputs:
11+
swiftorg:
12+
description: Swiftorg commit
13+
required: false
14+
type: string
1115
release:
1216
description: Create release?
1317
required: false
@@ -63,7 +67,7 @@ jobs:
6367
- name: Setup npm pacakges
6468
run: npm install --legacy-peer-deps
6569
env:
66-
SETUPSWIFT_SWIFTORG_METADATA: ${{ github.event_name == 'schedule' && '{"commit":"HEAD"}' }}
70+
SETUPSWIFT_SWIFTORG_METADATA: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.swiftorg != '' && format('{"commit":"{0}}"}', github.event.inputs.swiftorg) || github.event_name == 'workflow_dispatch' && github.event.inputs.swiftorg == 'true' || github.event_name == 'schedule' && '{"commit":"HEAD"}' }}
6771

6872
- name: Check latest swift.org
6973
id: swift-org

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[GitHub Action](https://github.com/features/actions) that will setup [Swift](https://swift.org) environment with specified version.
1111
This action supports the following functionalities:
1212

13-
- Works on Linux, macOS and Windows.
13+
- Works on Linux, macOS and Windows across all architectures.
1414
- Supports [installing latest major/minor/patch](#specifying-version).
1515
- Provides snapshots as soon as published in `swift.org`.
1616
- Verifies toolchain snapshots before installation (`gpg` for Linux and Windows, `pkgutil` for macOS) .

dist/index.js

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/installer/windows/index.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,20 @@ export class WindowsToolchainInstaller extends VerifyingToolchainInstaller<Windo
3030
)
3131
})
3232

33+
let compArch: string
34+
switch (arch) {
35+
case 'arm64':
36+
case 'arm':
37+
case 'arm64ec':
38+
compArch = arch.toUpperCase()
39+
break
40+
default:
41+
compArch = 'x86.x64'
42+
break
43+
}
44+
3345
const vsComponents = [
34-
`Microsoft.VisualStudio.Component.VC.Tools.${arch == 'arm64' ? 'ARM64' : 'x86.x64'}`,
46+
`Microsoft.VisualStudio.Component.VC.Tools.${compArch}`,
3547
...providedComponents
3648
]
3749
if (!winsdkComponent) {

src/utils/gpg.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export async function setupKeys() {
1515
'--keyserver',
1616
'hkp://keyserver.ubuntu.com',
1717
'--recv-keys',
18+
'52BB 7E3D E28A 71BE 22EC 05FF EF80 A866 B47A 981F',
1819
'7463 A81A 4B2E EA1B 551F FBCF D441 C977 412B 37AD',
1920
'1BE1 E29A 084C B305 F397 D62A 9F59 7F4D 21A5 6D5F',
2021
'A3BA FD35 56A5 9079 C068 94BD 63BC 1CFE 91D3 06C6',

0 commit comments

Comments
 (0)