Skip to content

Commit

Permalink
Support notarization on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
LabhanshAgrawal committed Oct 3, 2021
1 parent 64a2f90 commit 38d0f30
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 16 additions & 0 deletions bin/notarize.js
Original file line number Diff line number Diff line change
@@ -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
});
};
1 change: 1 addition & 0 deletions electron-builder.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "http://json.schemastore.org/electron-builder",
"appId": "co.zeit.hyper",
"afterSign": "./bin/notarize.js",
"directories": {
"app": "target"
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 38d0f30

Please sign in to comment.