Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit c33ed2f

Browse files
authored
Merge pull request #492 from autonomoussoftware/develop
1.4.3-2
2 parents 1c84532 + 01f551b commit c33ed2f

File tree

5 files changed

+112
-11
lines changed

5 files changed

+112
-11
lines changed

README.md

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@
1111

1212
## Development
1313

14+
Create a local `.env` file with the following content:
15+
16+
```shell
17+
ENABLED_CHAINS=
18+
ROPSTEN_NODE_URL=
19+
```
20+
1421
### Requirements
1522

1623
* [Node.js](https://nodejs.org) LTS (v12 minimum, v14 recommended)
1724

1825
### Launch
1926

20-
```bash
27+
```sh
2128
# Install dependencies
2229
npm i
2330

@@ -27,10 +34,10 @@ npm run dev
2734

2835
#### Troubleshooting
2936

30-
- If you get an error when installing the dependencies related to `node-gyp`, try using `sudo` to postinstall the deps
31-
- For windows, you might need to install the windows-build-tools. To do so, run
37+
- For errors related to `node-gyp` when installing the dependencies, try using `sudo` to postinstall the dependencies.
38+
- For Windows, installing `windows-build-tools` may be required. To do so, run:
3239

33-
```bash
40+
```sh
3441
npm i --global --production windows-build-tools
3542
```
3643

@@ -44,7 +51,7 @@ The log output is in the next directories:
4451

4552
`process-type` being equal to `main`, `renderer` or `worker`
4653

47-
More info [github.com/megahertz/electron-log](https://github.com/megahertz/electron-log)
54+
More info [github.com/megahertz/electron-log](https://github.com/megahertz/electron-log).
4855

4956
### Settings
5057

@@ -56,18 +63,67 @@ To completely remove the application and start over, remove the settings file to
5663

5764
### Production Build
5865

59-
```bash
66+
```sh
6067
# Run build process
6168
npm run dist
6269

70+
# or
71+
6372
# Run build process and publish to GitHub releases
6473
npm run release
6574
```
6675

67-
To sign the macOS installers, execute `npm run dist:mac`.
68-
The signing certificate shall be in the root folder and be named `met.p12`.
69-
The certificate password will be required before signing.
76+
#### macOs
77+
78+
The app needs to be signed and notarized.
79+
To do so, install the `.p12` file in the local keychain (double click on it).
80+
81+
The certificate is obtained from the Apple Developer website.
82+
The Developer ID Application is required.
83+
The Developer ID Installer may be required too.
84+
Once obtained, the `.cer` files have to be converted to `.p12` by providing the certificate passwords/private keys.
85+
86+
In addition to that, the following environment variables have to be set to publish:
87+
88+
```sh
89+
# See below to complete these two:
90+
APPLE_ID=
91+
APPLE_ID_PASSWORD=
92+
# See `electron-build` docs on how to complete these two:
93+
CSC_LINK=
94+
CSC_KEY_PASSWORD=
95+
# Github personal access token to upload the files to repo releases.
96+
GH_TOKEN=
97+
```
98+
99+
Follow [these steps to create an app specific password](https://support.apple.com/en-us/HT204397).
100+
The `APPLE_ID` variable is the Apple ID used to create the password.
101+
`APPLE_ID_PASSWORD` is the password Apple created for the app.
102+
103+
The GitHub personal access token needs `repo` permissions.
104+
See the docs on [how to create a personal access access token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more information.
105+
106+
The signing certificate shall be in the root folder of the repository.
107+
The certificate password will be required during the signing process.
108+
The signing process may take several minutes because notarization requieres uploading the app to Apple.
109+
110+
In order to verify that the application has been successfully signed and notarized, run:
111+
112+
```sh
113+
# Verifies the app has been signed
114+
codesign --verify --verbose ./dist/mac/Metronome\ Wallet.app
115+
116+
# Verifies the app has been notarized
117+
spctl -a -t exec -vvv ./dist/mac/Metronome\ Wallet.app
118+
```
119+
120+
#### Windows
121+
122+
To sign the application, a certificate for the Microsoft Authenticode platform is required.
123+
The certificate, a `.p7b` file, will then be required during the build process.
124+
125+
Current provider is [DigiCert](https://www.digicert.com).
70126

71127
## License
72128

73-
MIT
129+
MIT

entitlements.mac.plist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
6+
<true/>
7+
<key>com.apple.security.cs.allow-jit</key>
8+
<true/>
9+
</dict>
10+
</plist>

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"electron": "13.1.4",
7474
"electron-builder": "22.11.7",
7575
"electron-devtools-installer": "3.2.0",
76+
"electron-notarize": "1.0.0",
7677
"eslint-config-bloq": "2.4.0",
7778
"eslint-config-prettier": "8.3.0",
7879
"eslint-config-standard": "16.0.3",
@@ -107,14 +108,19 @@
107108
"directories": {
108109
"buildResources": "assets"
109110
},
111+
"afterSign": "scripts/notarize.js",
110112
"mac": {
111113
"artifactName": "${name}_v${version}.${ext}",
112114
"category": "public.app-category.finance",
113115
"icon": "./assets/icon.icns",
114116
"extendInfo": {
115117
"NSUserNotificationAlertStyle": "alert"
116118
},
117-
"electronUpdaterCompatibility": ">= 2.16"
119+
"electronUpdaterCompatibility": ">= 2.16",
120+
"hardenedRuntime": true,
121+
"gatekeeperAssess": false,
122+
"entitlements": "./entitlements.mac.plist",
123+
"entitlementsInherit": "./entitlements.mac.plist"
118124
},
119125
"dmg": {
120126
"backgroundColor": "#7e61f8",

scripts/notarize.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require('dotenv').config();
2+
const { notarize } = require('electron-notarize');
3+
4+
exports.default = function notarizing(context) {
5+
const { electronPlatformName, appOutDir } = context;
6+
if (electronPlatformName !== 'darwin') {
7+
return;
8+
}
9+
10+
const appName = context.packager.appInfo.productFilename;
11+
12+
return notarize({
13+
appBundleId: 'sh.autonomous.metronome.wallet.desktop',
14+
appPath: `${appOutDir}/${appName}.app`,
15+
appleId: process.env.APPLE_ID,
16+
appleIdPassword: process.env.APPLE_ID_PASSWORD,
17+
ascProvider: '99Y6CF5TBP'
18+
});
19+
};

0 commit comments

Comments
 (0)