Skip to content

Commit

Permalink
build: fix release id property
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed May 4, 2021
1 parent cade545 commit 78910ef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@ async function main() {
const result = await github.repos.getReleaseByTag({ owner, repo, tag: release.tag_name });
alreadyExists = true;
uploadUrl = result.data.upload_url;
releaseId = result.data.release_id;
releaseId = result.data.id;
url = result.data.html_url;
} catch (error) {
// doesn't exist yet!
// We'll create a draft release, append the assets to it, and then publish it.
const draftRelease = { ...release, draft: true };
const result = await github.repos.createRelease(draftRelease);
uploadUrl = result.data.upload_url;
releaseId = result.data.release_id;
releaseId = result.data.id;
url = result.data.html_url;
}

console.log(`alreadyExists ${alreadyExists}, releaseId ${releaseId}, uploadUrl ${uploadUrl}, url ${url}`);

// Append assets to the release
const BINDING_DIR = path.join(__dirname, `../build/stage/${owner}/${repo}/releases/download/${release.tag_name}`)
const tarballs = await fs.promises.readdir(BINDING_DIR);
Expand Down Expand Up @@ -100,4 +103,4 @@ main()
.catch(err => {
console.error(err);
process.exit(1);
});
});

0 comments on commit 78910ef

Please sign in to comment.