Skip to content

Commit edebf76

Browse files
committed
perf: improved gpg verification for new windows toolchains
1 parent 9f87bba commit edebf76

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

dist/index.js

+8-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/installer/verify.ts

+8-10
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ export abstract class VerifyingToolchainInstaller<
1515

1616
private async downloadSignature() {
1717
try {
18-
return this.signatureUrl
19-
? await toolCache.downloadTool(this.signatureUrl)
20-
: undefined
18+
if (this.signatureUrl) {
19+
core.debug(`Downloading snapshot signature from "${this.signatureUrl}"`)
20+
return await toolCache.downloadTool(this.signatureUrl)
21+
}
22+
return undefined
2123
} catch (error) {
2224
if (
2325
error instanceof toolCache.HTTPError &&
@@ -32,18 +34,14 @@ export abstract class VerifyingToolchainInstaller<
3234

3335
protected async download(arch: string) {
3436
const sigUrl = this.signatureUrl
37+
const signature = await this.downloadSignature()
3538
async function setupKeys() {
36-
if (sigUrl) {
39+
if (sigUrl && signature) {
3740
await gpg.setupKeys()
3841
}
3942
}
4043

41-
core.debug(`Downloading snapshot signature from "${sigUrl}"`)
42-
const [, toolchain, signature] = await Promise.all([
43-
setupKeys(),
44-
super.download(arch),
45-
this.downloadSignature()
46-
])
44+
const [, toolchain] = await Promise.all([setupKeys(), super.download(arch)])
4745
if (signature) {
4846
await gpg.verify(signature, toolchain)
4947
}

0 commit comments

Comments
 (0)