Skip to content

Commit

Permalink
ci: debug upload errors
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed Feb 2, 2020
1 parent d152705 commit fcb5554
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions utils/upload-artifact.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ const uploadArtifact = () => {
console.error('No version specified');
process.exit(1);
}
const releaseId = childProcess.execSync(`curl https://api.github.com/repos/manusa/electronim/releases/tags/v${version} | jq -r ".id"`,
{stdio: 'inherit'})
const releaseId = childProcess.execSync(`curl https://api.github.com/repos/manusa/electronim/releases/tags/v${version} | jq -r ".id"`)
.toString('utf8').replace(/\\r?\\n/g, '').trim();
console.log(`Uploading ${artifactFileName} with version ${version} to release ${releaseId}`);
const assetId = childProcess.execSync(`curl \\
-H "Authorization: token $GITHUB_TOKEN" \\
-H "Content-Type: ${mimeType}" \\
--data-binary "@${path.join('dist', artifactFileName)}" \\
"https://uploads.github.com/repos/manusa/electronim/releases/${releaseId}/assets?name=${artifactFileName}" \\
| jq -r ".id"`,
{stdio: 'inherit'})
| jq -r ".id"`)
.toString('utf8').replace(/\\r?\\n/g, '').trim();
if (!assetId) {
console.error(`Error uploading artifact ${artifactFileName} to release ${releaseId}`);
Expand Down

0 comments on commit fcb5554

Please sign in to comment.