build: ignore makeLatest on pre-releases (#37274)

* build: ignore makeLatest on pre-releases

* chore: set makeLatest to false by default

Co-authored-by: Samuel Attard <sam@electronjs.org>

---------

Co-authored-by: Samuel Attard <sam@electronjs.org>
This commit is contained in:
Keeley Hammond 2023-02-14 21:12:07 -08:00 committed by GitHub
parent d0cf9c4b08
commit 17ea7f42fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -318,12 +318,15 @@ function saveShaSumFile (checksums, fileName) {
}
async function publishRelease (release) {
let makeLatest = false;
if (!release.prerelease) {
const currentLatest = await octokit.repos.getLatestRelease({
owner: 'electron',
repo: targetRepo
});
const makeLatest = !release.prerelease && semver.gte(release.tag_name, currentLatest.data.tag_name);
makeLatest = semver.gte(release.tag_name, currentLatest.data.tag_name);
}
return octokit.repos.updateRelease({
owner: 'electron',