Skip to content
Merged
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
23 changes: 21 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"license": "MIT",
"homepage": "https://github.com/SwiftyLab/setup-swift#readme",
"swiftorg": {
"commit": "332574c8459304994580ac67605a8891d01da580",
"commit": "8485bd396d05e3a021c9b905d4f48ba204d1f589",
"release": {
"name": 5.9,
"tag": "swift-5.9-RELEASE",
"name": "5.9.1",
"tag": "swift-5.9.1-RELEASE",
"xcode": "Xcode 15",
"xcode_release": true,
"date": "2023-09-18T00:00:00.000Z",
"xcode_release": false,
"date": "2023-10-19T00:00:00.000Z",
"platforms": [
{
"name": "Ubuntu 18.04",
Expand All @@ -24,38 +24,38 @@
},
{
"name": "Ubuntu 20.04",
"docker": "5.9-focal",
"docker": "5.9.1-focal",
"archs": [
"x86_64",
"aarch64"
]
},
{
"name": "Ubuntu 22.04",
"docker": "5.9-jammy",
"docker": "5.9.1-jammy",
"archs": [
"x86_64",
"aarch64"
]
},
{
"name": "CentOS 7",
"docker": "5.9-centos7",
"docker": "5.9.1-centos7",
"archs": [
"x86_64"
]
},
{
"name": "Amazon Linux 2",
"docker": "5.9-amazonlinux2",
"docker": "5.9.1-amazonlinux2",
"archs": [
"x86_64",
"aarch64"
]
},
{
"name": "Red Hat Universal Base Image 9",
"docker": "5.9-rhel-ubi9",
"docker": "5.9.1-rhel-ubi9",
"dir": "ubi9",
"archs": [
"x86_64",
Expand All @@ -72,12 +72,12 @@
},
"dev": {
"name": "5.10",
"date": "2023-09-09T16:10:00.000Z",
"tag": "swift-5.10-DEVELOPMENT-SNAPSHOT-2023-09-09-a"
"date": "2023-10-24T16:10:00.000Z",
"tag": "swift-5.10-DEVELOPMENT-SNAPSHOT-2023-10-24-a"
},
"snapshot": {
"date": "2023-09-23T16:10:00.000Z",
"tag": "swift-DEVELOPMENT-SNAPSHOT-2023-09-23-a"
"date": "2023-10-24T16:10:00.000Z",
"tag": "swift-DEVELOPMENT-SNAPSHOT-2023-10-24-a"
}
},
"engines": {
Expand Down
24 changes: 22 additions & 2 deletions src/installer/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,35 @@ import {SignedToolchainSnapshot} from '../snapshot'
export abstract class VerifyingToolchainInstaller<
Snapshot extends SignedToolchainSnapshot
> extends ToolchainInstaller<Snapshot> {
private get signatureUrl() {
return `${this.baseUrl}/${this.data.download_signature}`
}

private async downloadSignature() {
try {
return await toolCache.downloadTool(this.signatureUrl)
} catch (error) {
if (
error instanceof toolCache.HTTPError &&
error.httpStatusCode === 404
) {
return undefined
}
throw error
}
}

protected async download() {
const sigUrl = `${this.baseUrl}/${this.data.download_signature}`
core.debug(`Downloading snapshot signature from "${sigUrl}"`)
const [, toolchain, signature] = await Promise.all([
gpg.setupKeys(),
super.download(),
toolCache.downloadTool(sigUrl)
this.downloadSignature()
])
await gpg.verify(signature, toolchain)
if (signature) {
await gpg.verify(signature, toolchain)
}
return toolchain
}
}
2 changes: 1 addition & 1 deletion swiftorg