Skip to content

Commit 0cc8b61

Browse files
committed
fix rme
1 parent a3deec0 commit 0cc8b61

1 file changed

Lines changed: 42 additions & 9 deletions

File tree

README.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,26 @@
88

99
**1. Initial Setup**
1010
1. Create an Apple Account if you don't have one.
11+
![Apple Account Sign In Page](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/create-apple-developer-account.jpg)
12+
1113
2. Install Xcode and Apple Developer App from the App Store.
1214
3. Open the Apple Developer App and subscribe to the $99 Apple Developer Program, providing accurate details as per your *National ID*.
1315
4. Wait until you receive the Apple Developer Program Welcome Email, which may take up to 48 hours.
1416

17+
![Apple Developer Program Subscription](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/apple-developer-program.png)
18+
19+
*Apple Developer Program subscription page*
20+
1521
**2. Get Required Credentials**
1622

1723
*App Specific Password:*
1824
1. Visit https://account.apple.com/account/manage.
1925
2. Sign in to your Apple Account.
2026
3. Create a new App Specific Password and store it securely.
2127

28+
![App Specific Password Creation](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/app-specific-password.png)
29+
*Creating an app-specific password in Apple Account settings*
30+
2231
*Developer ID Application Certificate:*
2332
1. Open Xcode > Settings > Account > "Manage Certificates".
2433
2. Click "+" to create a "Developer ID Application Certificate".
@@ -28,10 +37,15 @@
2837
- Name the file "certificate".
2938
- Save "certificate.p12" in a secure location.
3039

40+
![Export Certificate](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/export-certificate.png)
41+
3142
*Team ID:*
3243
1. Visit https://developer.apple.com/account.
3344
2. Scroll to the "Membership details" Card and copy the "Team ID" to a secure place.
3445

46+
![Apple Developer Team ID](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/team-id.png)
47+
*Finding your Team ID in the Apple Developer Portal*
48+
3549
**3. Sign and Notarize Sample Application**
3650

3751
*Important Notes:*
@@ -45,10 +59,10 @@ git clone https://github.com/omkarcloud/macos-code-signing-example
4559
cd macos-code-signing-example
4660
npm install
4761
```
48-
2. Ensure you have the latest version of Electron Builder installed to avoid any errors:
62+
2. Ensure you have the latest version of Electron Builder and Electron Notarize installed to avoid any errors:
4963

5064
```
51-
npm install --save-dev electron-builder@latest
65+
npm install --save-dev electron-builder@latest @electron/notarize@latest
5266
```
5367
3. Place the "certificate.p12" file exported earlier in the root directory.
5468
4. Create a "package-mac-signed.sh" file, paste the following content, and then replace placeholders with your credentials:
@@ -62,14 +76,18 @@ npm run package
6276
```
6377
5. Run `bash package-mac-signed.sh`.
6478
6. Once you see the "notarization successful" message in the terminal, you can now distribute the ".dmg" via the internet to your users without facing any security warnings. Hurray! 🎉
79+
80+
![Notarization Success](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/notarization-success.png)
81+
*Successful notarization message in terminal*
82+
6583
7. Now, let's proceed to sign and notarize your own custom application using Electron Builder.
6684

6785
**4. Signing Your Own Application**
6886

69-
1. Ensure you have the latest version of Electron Builder installed to avoid any errors:
87+
1. Ensure you have the latest version of Electron Builder and Electron Notarize installed to avoid any errors:
7088

7189
```
72-
npm install --save-dev electron-builder@latest
90+
npm install --save-dev electron-builder@latest @electron/notarize@latest
7391
```
7492
2. Ensure your "entitlements.mac.plist" has the following entitlements for Electron to function:
7593
```xml
@@ -233,6 +251,9 @@ certificate.p12
233251
9. Run `bash package-mac-signed.sh`.
234252
10. Wait until you see the "notarization successful" message in the terminal - your app is ready for the world to see! Congratulations! 🎉
235253

254+
![Notarization Success](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/notarization-success.png)
255+
*Your signed app is now ready for distribution*
256+
236257
### ❓ How to automate the above process using GitHub Actions?
237258

238259
**1. GitHub Repository Setup**
@@ -248,7 +269,7 @@ base64 -i certificate.p12
248269
2. Click "Create bucket".
249270
3. Configure the bucket:
250271
```
251-
Bucket name: Enter a unique bucket name in kebab case (e.g., my-app-name-distribution)
272+
Bucket name: Enter a unique bucket name. Conventionally, this name matches your product's name in kebab case. For example, if your product is named "Chess Master," your bucket name will be `chess-master`.
252273
Object Ownership: Select ACLs enabled
253274
Block Public Access settings for this bucket: Uncheck "Block all public access"
254275
```
@@ -261,6 +282,9 @@ Ensure that **Object Ownership** is set to **"ACLs enabled"** because Electron B
261282

262283
4. Click on "Create bucket".
263284

285+
![S3 Bucket Creation](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/s3-bucket-setup.png)
286+
*Creating an S3 bucket for app distribution*
287+
264288
5. If you don't have an AWS access key and secret key, get them.
265289

266290
**3. Configure GitHub Secrets**
@@ -275,6 +299,9 @@ AWS_ACCESS_KEY_ID # AWS access key
275299
AWS_SECRET_ACCESS_KEY # AWS secret key
276300
```
277301

302+
![GitHub Secrets](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/github-secrets.png)
303+
*Adding secrets to your GitHub repository*
304+
278305
**4. Configure Electron Builder**
279306
1. In your "package.json" file, add the following to the Electron "build" configuration:
280307
```json
@@ -285,7 +312,7 @@ AWS_SECRET_ACCESS_KEY # AWS secret key
285312
}
286313
}
287314
```
288-
Replace "YOUR_S3_BUCKET_NAME" with the name of your S3 bucket.
315+
Replace "YOUR_S3_BUCKET_NAME" with the name of your S3 bucket.
289316

290317
2. Add a new script called "package:publish" to the "scripts" section of your "package.json" file:
291318
```json
@@ -388,20 +415,26 @@ jobs:
388415
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
389416
```
390417
418+
391419
**6. Deploy**
392-
1. Push the code to GitHub.
420+
1. Push the code to GitHub repository.
393421
2. Go to the repository's "Actions" tab to see the build process in action.
422+
![GitHub Actions Workflow](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/github-actions.png)
394423
3. After a successful build, the installer files will be found in your S3 bucket. These files will be publicly accessible in the following format:
395424
```
396425
https://<your-bucket-name>.s3.amazonaws.com/<your-product-name>.dmg
397426
```
398427

399428
Examples:
400-
- https://awesome-app-distribution.s3.amazonaws.com/ElectronReact.dmg
401-
- https://awesome-app-distribution.s3.amazonaws.com/Awesome+App.dmg
429+
- https://chess-master.s3.amazonaws.com/Chess+Master.dmg
430+
- https://chess-master.s3.amazonaws.com/Chess+Master.exe
431+
- https://chess-master.s3.amazonaws.com/Chess+Master.deb
432+
- https://chess-master.s3.amazonaws.com/Chess+Master.rpm
402433

403434
4. Share the URL with your users to download the signed and notarized executable. Hurray! 🎉
404435

436+
![S3 Distribution](https://raw.githubusercontent.com/omkarcloud/macos-code-signing-example/master/images/s3-distribution.png)
437+
405438
### ❓ How to Set Up Auto Update for my Electron App?
406439

407440
Electron Builder's auto-update feature makes life much easier for your users by allowing you to push updates without requiring them to manually download and install the new version.

0 commit comments

Comments
 (0)