Browse Source

Notarize Mac

tags/v0.9.2
Aditya Kulkarni 3 months ago
parent
commit
45f5add285
4 changed files with 46 additions and 75 deletions
  1. +0
    -74
      .travis.yml
  2. +35
    -0
      afterSignHook.js
  3. +3
    -1
      package.json
  4. +8
    -0
      yarn.lock

+ 0
- 74
.travis.yml View File

@@ -1,74 +0,0 @@
matrix:
include:
- os: osx
language: node_js
node_js:
- node
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
- os: linux
language: node_js
node_js:
- node
services:
- xvfb
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-multilib
- g++-8
- g++-multilib
- icnsutils
- graphicsmagick
- xz-utils
- xorriso
- rpm

before_cache:
- rm -rf $HOME/.cache/electron-builder/wine

cache:
yarn: true
directories:
- node_modules
- $(npm config get prefix)/lib/node_modules
- flow-typed
- $HOME/.cache/electron
- $HOME/.cache/electron-builder

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX="g++-8"; fi

install:
- yarn --ignore-engines
# On Linux, initialize "virtual display". See before_script
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
/sbin/start-stop-daemon \
--start \
--quiet \
--pidfile /tmp/custom_xvfb_99.pid \
--make-pidfile \
--background \
--exec /usr/bin/Xvfb \
-- :99 -ac -screen 0 1280x1024x16
else
:
fi

before_script:
# On Linux, create a "virtual display". This allows browsers to work properly
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DISPLAY=:99.0; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sleep 3; fi

script:
- yarn package-ci
- yarn lint
- yarn flow
# HACK: Temporarily ignore `yarn test` on linux
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then yarn test; fi
- yarn build-e2e
- yarn test-e2e

+ 35
- 0
afterSignHook.js View File

@@ -0,0 +1,35 @@
/* eslint-disable camelcase */
const fs = require('fs');
const electron_notarize = require('electron-notarize');

module.exports = async function(params) {
// Only notarize the app on Mac OS only.
if (process.platform !== 'darwin') {
return;
}
// console.log('afterSign hook triggered', params);

// Same appId in electron-builder.
const appId = 'co.zecwallet.fullnode';

const appPath = params.artifactPaths.find(p => p.endsWith('.dmg'));

if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`);
}

console.log(`Notarizing ${appId} found at ${appPath}`);

try {
await electron_notarize.notarize({
appBundleId: appId,
appPath,
appleId: process.env.appleId,
appleIdPassword: process.env.appleIdPassword
});
} catch (error) {
console.error(error);
}

console.log(`Done notarizing ${appId}`);
};

+ 3
- 1
package.json View File

@@ -1,7 +1,7 @@
{
"name": "zecwallet",
"productName": "Zecwallet FullNode",
"version": "0.9.1",
"version": "0.9.2",
"description": "Zecwallet FullNode (Electron version)",
"scripts": {
"build": "concurrently \"yarn build-main\" \"yarn build-renderer\"",
@@ -59,6 +59,7 @@
"build": {
"productName": "Zecwallet FullNode",
"appId": "co.zecwallet.fullnode",
"afterAllArtifactBuild": "./afterSignHook.js",
"files": [
"dist/",
"node_modules/",
@@ -252,6 +253,7 @@
"electron": "7.1.4",
"electron-builder": "^22.2.0",
"electron-devtools-installer": "^2.2.4",
"electron-notarize": "^0.2.1",
"electron-rebuild": "^1.8.8",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.7.0",


+ 8
- 0
yarn.lock View File

@@ -5608,6 +5608,14 @@ electron-log@^4.0.0:
resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-4.0.0.tgz#9315e4a5e6be5e2a158909856b2d2cb4d760cd6d"
integrity sha512-pj5Om0XoImjoq60zgvTv86W+2+7VMQIW0jmKWkXXTTjiC2L2WNfNDfMbpqo8Qj2szY1LsVyFhgRNBLXVrYNDJQ==

electron-notarize@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/electron-notarize/-/electron-notarize-0.2.1.tgz#759e8006decae19134f82996ed910db26d9192cc"
integrity sha512-oZ6/NhKeXmEKNROiFmRNfytqu3cxqC95sjooG7kBXQVEUSQkZnbiAhxVh5jXngL881G197pbwpeVPJyM7Ikmxw==
dependencies:
debug "^4.1.1"
fs-extra "^8.1.0"

electron-publish@21.2.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-21.2.0.tgz#cc225cb46aa62e74b899f2f7299b396c9802387d"


Loading…
Cancel
Save