mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
ci: add logging to uploading to GitHub releases (#41453)
This commit is contained in:
committed by
GitHub
parent
b468b5e6e8
commit
267c0796dd
@@ -27,7 +27,9 @@ const getHeaders = (filePath: string, fileName: string) => {
|
||||
if (!extension) {
|
||||
throw new Error(`Failed to get headers for extensionless file: ${fileName}`);
|
||||
}
|
||||
console.log(`About to get size of ${filePath}`);
|
||||
const size = fs.statSync(filePath).size;
|
||||
console.log(`Got size of ${filePath}: ${size}`);
|
||||
const options: Record<string, string> = {
|
||||
json: 'text/json',
|
||||
zip: 'application/zip',
|
||||
@@ -46,10 +48,13 @@ const uploadUrl = `https://uploads.github.com/repos/electron/${targetRepo}/relea
|
||||
let retry = 0;
|
||||
|
||||
function uploadToGitHub () {
|
||||
console.log(`in uploadToGitHub for ${filePath}, ${fileName}`);
|
||||
const fileData = fs.createReadStream(filePath);
|
||||
console.log(`in uploadToGitHub, created readstream for ${filePath}`);
|
||||
octokit.repos.uploadReleaseAsset({
|
||||
url: uploadUrl,
|
||||
headers: getHeaders(filePath, fileName),
|
||||
data: fs.createReadStream(filePath) as any,
|
||||
data: fileData as any,
|
||||
name: fileName,
|
||||
owner: 'electron',
|
||||
repo: targetRepo,
|
||||
|
||||
Reference in New Issue
Block a user