aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-06-15 08:27:19 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-06-15 08:32:22 +0530
commit40d14fa9f5edd8eb71f697eb8fe412bd0cd35bfd (patch)
tree90d1b52b139d1f3b297880e9fdc38ae04d744c58
parentUpgraded some npm modules (#1525) (diff)
downloadferdi-40d14fa9f5edd8eb71f697eb8fe412bd0cd35bfd.tar.gz
ferdi-40d14fa9f5edd8eb71f697eb8fe412bd0cd35bfd.tar.zst
ferdi-40d14fa9f5edd8eb71f697eb8fe412bd0cd35bfd.zip
Skip notarization of the build artifact if not building for the main repo (ie building on a forked repo)..
-rw-r--r--.github/workflows/ferdi-builds.yml2
-rw-r--r--build-helpers/notarize.js12
2 files changed, 8 insertions, 6 deletions
diff --git a/.github/workflows/ferdi-builds.yml b/.github/workflows/ferdi-builds.yml
index fc87275c..74defe01 100644
--- a/.github/workflows/ferdi-builds.yml
+++ b/.github/workflows/ferdi-builds.yml
@@ -107,6 +107,7 @@ jobs:
107 echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV 107 echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV
108 echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV 108 echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV
109 echo "FORCE_REBUILD_ON_NIGHTLY=${{ contains(github.event.inputs.message, 'force build') && contains(github.event.inputs.message, 'nightly branch') }}" >> $GITHUB_ENV 109 echo "FORCE_REBUILD_ON_NIGHTLY=${{ contains(github.event.inputs.message, 'force build') && contains(github.event.inputs.message, 'nightly branch') }}" >> $GITHUB_ENV
110 echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV
110 - name: Set env vars for Windows 111 - name: Set env vars for Windows
111 if: startsWith(runner.os, 'Windows') 112 if: startsWith(runner.os, 'Windows')
112 run: | 113 run: |
@@ -115,6 +116,7 @@ jobs:
115 echo "ELECTRON_CACHE=$USERPROFILE\.cache\electron" >> $GITHUB_ENV 116 echo "ELECTRON_CACHE=$USERPROFILE\.cache\electron" >> $GITHUB_ENV
116 echo "ELECTRON_BUILDER_CACHE=$USERPROFILE\.cache\electron-builder" >> $GITHUB_ENV 117 echo "ELECTRON_BUILDER_CACHE=$USERPROFILE\.cache\electron-builder" >> $GITHUB_ENV
117 echo "FORCE_REBUILD_ON_NIGHTLY=${{ contains(github.event.inputs.message, 'force build') && contains(github.event.inputs.message, 'nightly branch') }}" >> $GITHUB_ENV 118 echo "FORCE_REBUILD_ON_NIGHTLY=${{ contains(github.event.inputs.message, 'force build') && contains(github.event.inputs.message, 'nightly branch') }}" >> $GITHUB_ENV
119 echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV
118 shell: bash 120 shell: bash
119 - 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 121 - 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
120 uses: actions/checkout@v2 122 uses: actions/checkout@v2
diff --git a/build-helpers/notarize.js b/build-helpers/notarize.js
index d5a6027f..1d930288 100644
--- a/build-helpers/notarize.js
+++ b/build-helpers/notarize.js
@@ -1,18 +1,18 @@
1const { notarize } = require("electron-notarize"); 1const { notarize } = require('electron-notarize');
2 2
3exports.default = async function notarizing(context) { 3exports.default = async function notarizing(context) {
4 const { electronPlatformName, appOutDir } = context; 4 const { electronPlatformName, appOutDir } = context;
5 if (electronPlatformName !== "darwin" || (process.env.GIT_BRANCH_NAME !== 'release' && process.env.GIT_BRANCH_NAME !== 'nightly')) { 5 if (electronPlatformName !== 'darwin' || process.env.SKIP_NOTARIZATION === 'true' || (process.env.GIT_BRANCH_NAME !== 'release' && process.env.GIT_BRANCH_NAME !== 'nightly')) {
6 return; 6 return;
7 } 7 }
8 8
9 const appName = context.packager.appInfo.productFilename; 9 const appName = context.packager.appInfo.productFilename;
10 10
11 return await notarize({ 11 await notarize({
12 appBundleId: "com.kytwb.ferdi", 12 appBundleId: 'com.kytwb.ferdi',
13 appPath: `${appOutDir}/${appName}.app`, 13 appPath: `${appOutDir}/${appName}.app`,
14 ascProvider: "B6J9X9DWFL", 14 ascProvider: 'B6J9X9DWFL',
15 appleId: process.env.APPLEID, 15 appleId: process.env.APPLEID,
16 appleIdPassword: process.env.APPLEID_PASSWORD 16 appleIdPassword: process.env.APPLEID_PASSWORD,
17 }); 17 });
18}; 18};