From 40d14fa9f5edd8eb71f697eb8fe412bd0cd35bfd Mon Sep 17 00:00:00 2001 From: Vijay A Date: Tue, 15 Jun 2021 08:27:19 +0530 Subject: Skip notarization of the build artifact if not building for the main repo (ie building on a forked repo).. --- .github/workflows/ferdi-builds.yml | 2 ++ build-helpers/notarize.js | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ferdi-builds.yml b/.github/workflows/ferdi-builds.yml index fc87275c4..74defe01e 100644 --- a/.github/workflows/ferdi-builds.yml +++ b/.github/workflows/ferdi-builds.yml @@ -107,6 +107,7 @@ jobs: echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV echo "FORCE_REBUILD_ON_NIGHTLY=${{ contains(github.event.inputs.message, 'force build') && contains(github.event.inputs.message, 'nightly branch') }}" >> $GITHUB_ENV + echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV - name: Set env vars for Windows if: startsWith(runner.os, 'Windows') run: | @@ -115,6 +116,7 @@ jobs: echo "ELECTRON_CACHE=$USERPROFILE\.cache\electron" >> $GITHUB_ENV echo "ELECTRON_BUILDER_CACHE=$USERPROFILE\.cache\electron-builder" >> $GITHUB_ENV echo "FORCE_REBUILD_ON_NIGHTLY=${{ contains(github.event.inputs.message, 'force build') && contains(github.event.inputs.message, 'nightly branch') }}" >> $GITHUB_ENV + echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV shell: bash - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' or this is a forced rebuild on the nightly branch uses: actions/checkout@v2 diff --git a/build-helpers/notarize.js b/build-helpers/notarize.js index d5a6027fb..1d9302880 100644 --- a/build-helpers/notarize.js +++ b/build-helpers/notarize.js @@ -1,18 +1,18 @@ -const { notarize } = require("electron-notarize"); +const { notarize } = require('electron-notarize'); exports.default = async function notarizing(context) { const { electronPlatformName, appOutDir } = context; - if (electronPlatformName !== "darwin" || (process.env.GIT_BRANCH_NAME !== 'release' && process.env.GIT_BRANCH_NAME !== 'nightly')) { + if (electronPlatformName !== 'darwin' || process.env.SKIP_NOTARIZATION === 'true' || (process.env.GIT_BRANCH_NAME !== 'release' && process.env.GIT_BRANCH_NAME !== 'nightly')) { return; } const appName = context.packager.appInfo.productFilename; - return await notarize({ - appBundleId: "com.kytwb.ferdi", + await notarize({ + appBundleId: 'com.kytwb.ferdi', appPath: `${appOutDir}/${appName}.app`, - ascProvider: "B6J9X9DWFL", + ascProvider: 'B6J9X9DWFL', appleId: process.env.APPLEID, - appleIdPassword: process.env.APPLEID_PASSWORD + appleIdPassword: process.env.APPLEID_PASSWORD, }); }; -- cgit v1.2.3-70-g09d2