fix(ci): dist.ipfs.io sync preserving binaries
tar.gz got mangled because of reasons known to github, this does the correct upload every time by forcing github to interpret payload as an opaque stream of bytes without anything fancy
Marcin Rataj committed
Dec 6, 2021 at 20:24 UTC
7026952c71eca57d30709f3446d1c7456627602f
1 file changed
+5
-2
.github/workflows/sync-release-assets.yml
+5
-2
@@ -107,14 +107,17 @@ jobs:
107
for (const file of missing_files) {
108
console.log("fetching", file, "from dist.ipfs.io")
109
await exec.exec('ipfs', ['get', p + '/' + file])
110
- const data = await fs.readFile(file, "binary")
110
console.log("uploading", file, "to github release", release.tag_name)
111
resp = await github.repos.uploadReleaseAsset({
112
owner: context.repo.owner,
113
repo: context.repo.repo,
114
release_id: release.id,
115
+ headers: {
116
+ "content-type": "application/octet-stream",
117
+ "content-length": `${(await fs.stat(file)).size}`
118
+ },
119
name: file,
117
- data: data,
120
+ data: await fs.readFile(file),
121
})
122
}
123
// summary of assets on both sides