From 6fbb2a22741d5412331ca220c18358c897f3eb13 Mon Sep 17 00:00:00 2001 From: Jai A P Date: Tue, 30 Aug 2022 11:40:10 +0530 Subject: [PATCH] Fix Build on MacOS and Win Fix build if GH_TOKEN or GITHUB_TOKEN is null on Mac OS and Windows --- scripts/build-macos.js | 4 ++-- scripts/build-windows.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build-macos.js b/scripts/build-macos.js index 716c8293..45d51ac9 100755 --- a/scripts/build-macos.js +++ b/scripts/build-macos.js @@ -25,12 +25,12 @@ builder({ identity: !process.env.CI || process.env.CSC_LINK ? undefined : null, }, npmRebuild: process.env.ARCH !== 'arm64', - publish: process.env.GH_TOKEN ? { + publish: process.env.GH_TOKEN || process.env.GITHUB_TOKEN ? { provider: 'github', channel: `latest-${process.env.ARCH}`, } : undefined, }, - publish: isTag ? 'always' : 'onTagOrDraft', + publish: ( process.env.GH_TOKEN || process.env.GITHUB_TOKEN ) ? ( isTag ? 'always' : 'onTagOrDraft' ) : 'never', }).catch(e => { console.error(e) process.exit(1) diff --git a/scripts/build-windows.js b/scripts/build-windows.js index 8d2154a2..ee29ffea 100755 --- a/scripts/build-windows.js +++ b/scripts/build-windows.js @@ -15,10 +15,10 @@ builder({ extraMetadata: { version: vars.version, }, - publish: process.env.GH_TOKEN ? { + publish: process.env.GH_TOKEN || process.env.GITHUB_TOKEN ? { provider: 'github', channel: `latest-${process.arch}`, } : undefined, }, - publish: isTag ? 'always' : 'onTagOrDraft', + publish: ( process.env.GH_TOKEN || process.env.GITHUB_TOKEN ) ? ( isTag ? 'always' : 'onTagOrDraft' ) : 'never', }).catch(() => process.exit(1))