Support notarization on macOS

This commit is contained in:
Labhansh Agrawal 2021-10-03 12:36:59 +05:30
parent 64a2f90957
commit 38d0f30734
5 changed files with 28 additions and 0 deletions

View file

@ -47,6 +47,8 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets.MAC_CERT_P12_PASSWORD }}
WIN_CSC_LINK: ${{ secrets.WIN_CERT_P12_BASE64 }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CERT_P12_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
- name: Archive Build Artifacts
uses: LabhanshAgrawal/upload-artifact@v3
with:

16
bin/notarize.js vendored Normal file
View file

@ -0,0 +1,16 @@
const { notarize } = require("electron-notarize");
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== "darwin" || !process.env.APPLE_ID || !process.env.APPLE_PASSWORD) {
return;
}
const appName = context.packager.appInfo.productFilename;
return await notarize({
appBundleId: "co.zeit.hyper",
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD
});
};

View file

@ -1,6 +1,7 @@
{
"$schema": "http://json.schemastore.org/electron-builder",
"appId": "co.zeit.hyper",
"afterSign": "./bin/notarize.js",
"directories": {
"app": "target"
},

View file

@ -99,6 +99,7 @@
"electron": "^13.2.3",
"electron-builder": "^22.11.7",
"electron-devtools-installer": "3.2.0",
"electron-notarize": "1.1.1",
"electron-rebuild": "3.2.3",
"electronmon": "^2.0.2",
"eslint": "7.32.0",

View file

@ -3062,6 +3062,14 @@ electron-devtools-installer@3.2.0:
tslib "^2.1.0"
unzip-crx-3 "^0.2.0"
electron-notarize@1.1.1:
version "1.1.1"
resolved "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.1.1.tgz#3ed274b36158c1beb1dbef14e7faf5927e028629"
integrity sha512-kufsnqh86CTX89AYNG3NCPoboqnku/+32RxeJ2+7A4Rbm4bbOx0Nc7XTy3/gAlBfpj9xPAxHfhZLOHgfi6cJVw==
dependencies:
debug "^4.1.1"
fs-extra "^9.0.1"
electron-publish@22.11.7:
version "22.11.7"
resolved "https://registry.npmjs.org/electron-publish/-/electron-publish-22.11.7.tgz#4126cbb08ccf082a2aa7fef89ee629b3a4b8ae9a"