ci: add logging to uploading to GitHub releases (#41453)
This commit is contained in:
parent
b468b5e6e8
commit
267c0796dd
2 changed files with 12 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue