Skip to content

Commit

Permalink
Support .vsix artifacts in pre-release registry (#6602)
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa authored Aug 29, 2024
1 parent 3bd833c commit bf2e03e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-crews-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/prerelease-registry": minor
---

feat: Support `.vsix` artifacts in pre-release registry
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,15 @@ export const getArtifactForWorkflowRun = async ({

const files = zip.files;
const fileNames = Object.keys(files);
const tgzFileName = fileNames.find((fileName) => fileName.endsWith(".tgz"));
if (tgzFileName === undefined) {
const downloadableFileName = fileNames.find(
(fileName) => fileName.endsWith(".tgz") || fileName.endsWith(".vsix")
);
if (downloadableFileName === undefined) {
return Response.json({ fileNames }, { status: 404 });
}

const tgzBlob = await files[tgzFileName].async("blob");
const response = new Response(tgzBlob, {
const downloadableBlob = await files[downloadableFileName].async("blob");
const response = new Response(downloadableBlob, {
headers: { "Cache-Control": `public, s-maxage=${ONE_WEEK}` },
});

Expand Down

0 comments on commit bf2e03e

Please sign in to comment.