mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-04-02 01:30:17 +08:00
Do not cache action releases
This commit is contained in:
parent
1c8c9a7615
commit
4573031972
10
dist/setup.js
vendored
10
dist/setup.js
vendored
@ -60,14 +60,14 @@ function getDownloadUrl(options) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
const release = encodeURIComponent(options?.version ?? "latest");
|
const release = encodeURIComponent(options?.version ?? "latest");
|
||||||
const os = options?.os ?? process.platform;
|
const os = encodeURIComponent(options?.os ?? process.platform);
|
||||||
const arch = options?.arch ?? process.arch;
|
const arch = encodeURIComponent(options?.arch ?? process.arch);
|
||||||
const avx2 = options?.avx2 ?? true;
|
const avx2 = encodeURIComponent(options?.avx2 ?? true);
|
||||||
const profile = options?.profile ?? false;
|
const profile = encodeURIComponent(options?.profile ?? false);
|
||||||
const { href } = new URL(`${release}/${os}/${arch}?avx2=${avx2}&profile=${profile}`, "https://bun.sh/download/");
|
const { href } = new URL(`${release}/${os}/${arch}?avx2=${avx2}&profile=${profile}`, "https://bun.sh/download/");
|
||||||
return {
|
return {
|
||||||
url: href,
|
url: href,
|
||||||
cacheKey: /^canary|latest$/i.test(release)
|
cacheKey: /^latest|canary|action/i.test(release)
|
||||||
? null
|
? null
|
||||||
: `bun-${release}-${os}-${arch}-${avx2}-${profile}`,
|
: `bun-${release}-${os}-${arch}-${avx2}-${profile}`,
|
||||||
};
|
};
|
||||||
|
10
src/setup.ts
10
src/setup.ts
@ -80,17 +80,17 @@ function getDownloadUrl(options?: {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
const release = encodeURIComponent(options?.version ?? "latest");
|
const release = encodeURIComponent(options?.version ?? "latest");
|
||||||
const os = options?.os ?? process.platform;
|
const os = encodeURIComponent(options?.os ?? process.platform);
|
||||||
const arch = options?.arch ?? process.arch;
|
const arch = encodeURIComponent(options?.arch ?? process.arch);
|
||||||
const avx2 = options?.avx2 ?? true;
|
const avx2 = encodeURIComponent(options?.avx2 ?? true);
|
||||||
const profile = options?.profile ?? false;
|
const profile = encodeURIComponent(options?.profile ?? false);
|
||||||
const { href } = new URL(
|
const { href } = new URL(
|
||||||
`${release}/${os}/${arch}?avx2=${avx2}&profile=${profile}`,
|
`${release}/${os}/${arch}?avx2=${avx2}&profile=${profile}`,
|
||||||
"https://bun.sh/download/"
|
"https://bun.sh/download/"
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
url: href,
|
url: href,
|
||||||
cacheKey: /^canary|latest$/i.test(release)
|
cacheKey: /^latest|canary|action/i.test(release)
|
||||||
? null
|
? null
|
||||||
: `bun-${release}-${os}-${arch}-${avx2}-${profile}`,
|
: `bun-${release}-${os}-${arch}-${avx2}-${profile}`,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user