Skip to content

Commit

Permalink
cd: Fix deployment of packages to release
Browse files Browse the repository at this point in the history
  • Loading branch information
kf6kjg committed Jun 4, 2021
1 parent a5e8365 commit 883e137
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/scripts/cd/upload_release_artifact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { promises as FS } from "fs";
import { promises as FS, createReadStream } from "fs";
import Path from "path";

import { context, getOctokit } from "@actions/github";
Expand Down Expand Up @@ -34,14 +34,11 @@ export async function uploadReleaseArtifact(
await github.repos.uploadReleaseAsset({
...context.repo,
// baseUrl: releaseInfo.release.uploadUrl,
data: await FS.readFile(artifactPath, "binary"), // This is such a bad idea. Why didn't they utilize a file stream interface?!
data: createReadStream(artifactPath) as unknown as string, // This is such a bad idea. Why didn't they utilize a clean file stream interface?! No base64, no "strings", just bytes.
headers: {
"content-length": (await FS.stat(artifactPath)).size,
"content-type": artifactMimeType,
},
mediaType: {
format: "raw",
},
name,
release_id: releaseInfo.release.id,
});
Expand Down

0 comments on commit 883e137

Please sign in to comment.