Skip to content

Commit c683272

Browse files
committed
notarize prep
1 parent aef63a6 commit c683272

File tree

4 files changed

+3455
-88
lines changed

4 files changed

+3455
-88
lines changed

Diff for: .github/workflows/build.yml

+44-37
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,53 @@
1-
name: Build
1+
name: Build and Release
22

3-
on: [push, workflow_dispatch]
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Trigger on version tags like v1.0.0
47

58
jobs:
69
build_desktop:
710
name: Build Desktop on ${{ matrix.os }}
811
runs-on: ${{ matrix.os }}
912
strategy:
1013
matrix:
11-
os: [windows-latest, macos-latest]
14+
os: [windows-latest, macos-latest, ubuntu-latest]
1215
steps:
13-
- uses: actions/checkout@v1
14-
- name: Setup Node.js
15-
uses: actions/setup-node@v1
16-
with:
17-
node-version: 18
18-
- name: Install dependencies
19-
run: npm i
20-
- name: Build
21-
uses: samuelmeuli/[email protected]
22-
with:
23-
github_token: ${{ secrets.github_token }}
24-
release: true
25-
skip_build: true
26-
## - name: Get current version
27-
## uses: Saionaro/[email protected]
28-
## id: package-version
29-
## - name: Upload Artifact
30-
## uses: actions/upload-artifact@v2
31-
## if: matrix.os == 'ubuntu-latest'
32-
## with:
33-
## name: 'beacon-${{ steps.package-version.outputs.version }}-Linux'
34-
## path: 'release/beacon-${{ steps.package-version.outputs.version }}.AppImage'
35-
## - name: Upload Artifact
36-
## uses: actions/upload-artifact@v2
37-
## if: matrix.os == 'macos-latest'
38-
## with:
39-
## name: 'beacon-${{ steps.package-version.outputs.version }}-MacOS'
40-
## path: 'release/beacon-${{ steps.package-version.outputs.version }}.dmg'
41-
## - name: Upload Artifact
42-
## uses: actions/upload-artifact@v2
43-
## if: matrix.os == 'windows-latest'
44-
## with:
45-
## name: 'beacon-${{ steps.package-version.outputs.version }}-Windows'
46-
## path: 'release/beacon Setup ${{ steps.package-version.outputs.version }}.exe'
16+
- uses: actions/checkout@v3
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 20
21+
22+
- name: Install dependencies
23+
run: yarn install --production
24+
25+
# macOS-specific steps for code signing and notarization
26+
- name: Import Apple Developer Certificate (macOS only)
27+
if: matrix.os == 'macos-latest'
28+
env:
29+
DEVELOPER_ID_CERT: ${{ secrets.DEVELOPER_ID_CERT }}
30+
DEVELOPER_ID_CERT_PASSWORD: ${{ secrets.DEVELOPER_ID_CERT_PASSWORD }}
31+
run: |
32+
echo "$DEVELOPER_ID_CERT" | base64 --decode > developer_id_certificate.p12
33+
security create-keychain -p "" build.keychain
34+
security default-keychain -s build.keychain
35+
security unlock-keychain -p "" build.keychain
36+
security import developer_id_certificate.p12 -k build.keychain -P "$DEVELOPER_ID_CERT_PASSWORD" -T /usr/bin/codesign
37+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" build.keychain
38+
39+
- name: List Certificates in Keychain (macOS only)
40+
if: matrix.os == 'macos-latest'
41+
run: |
42+
security find-identity -v -p codesigning
43+
44+
- name: Build and Release
45+
uses: samuelmeuli/[email protected]
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
release: true
49+
env:
50+
DEBUG: electron-notarize*
51+
APPLE_ID: ${{ secrets.APPLE_ID }}
52+
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
53+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}

Diff for: entitlements.mac.plist

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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-dyld-environment-variables</key>
6+
<true/>
7+
<key>com.apple.security.cs.disable-library-validation</key>
8+
<true/>
9+
<key>com.apple.security.cs.allow-jit</key>
10+
<true/>
11+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
12+
<true/>
13+
<key>com.apple.security.cs.debugger</key>
14+
<true/>
15+
<key>com.apple.security.network.client</key>
16+
<true/>
17+
<key>com.apple.security.network.server</key>
18+
<true/>
19+
<key>com.apple.security.files.user-selected.read-only</key>
20+
<true/>
21+
<key>com.apple.security.inherit</key>
22+
<true/>
23+
<key>com.apple.security.automation.apple-events</key>
24+
<true/>
25+
</dict>
26+
</plist>

Diff for: package.json

+50-51
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,54 @@
11
{
22
"name": "beacon",
3-
"productName": "beacon",
4-
"version": "0.2.0",
3+
"version": "1.0.0",
4+
"author": "Joseph Adams <[email protected]>",
55
"description": "Control a USB Busylight as a Beacon/Notification",
6-
"license": "MIT",
7-
"repository": "josephdadams/beacon",
8-
"author": {
9-
"name": "Joseph Adams",
10-
"email": "[email protected]",
11-
"url": "https://josephadams.dev"
12-
},
6+
"main": "dist/main.js",
137
"scripts": {
14-
"postinstall": "electron-builder install-app-deps",
15-
"lint": "xo",
16-
"test": "npm run lint",
178
"start": "electron .",
18-
"pack": "electron-builder --dir",
19-
"dist": "electron-builder --macos --linux --windows",
20-
"release": "np"
9+
"format": "prettier -w .",
10+
"lint:raw": "eslint --ext .ts --ext .js --ignore-pattern dist --ignore-pattern pkg",
11+
"lint": "yarn lint:raw ."
12+
},
13+
"build": {
14+
"appId": "com.josephadams.beacon",
15+
"productName": "beacon",
16+
"files": [
17+
"dist/**/*",
18+
"public/**/*",
19+
"assets/**/*"
20+
],
21+
"mac": {
22+
"target": [
23+
{
24+
"target": "dmg",
25+
"arch": [
26+
"x64",
27+
"arm64"
28+
]
29+
}
30+
],
31+
"category": "public.app-category.utilities",
32+
"icon": "assets/tray-icon.png",
33+
"identity": "Joseph Adams (R2PY2DC3A4)",
34+
"extendInfo": {
35+
"NSApplicationSupportsSecureRestorableState": true,
36+
"electronTeamId": "R2PY2DC3A4"
37+
},
38+
"hardenedRuntime": true,
39+
"gatekeeperAssess": true,
40+
"entitlements": "entitlements.mac.plist",
41+
"entitlementsInherit": "entitlements.mac.plist"
42+
},
43+
"win": {
44+
"target": "nsis",
45+
"icon": "assets/icon.ico"
46+
},
47+
"linux": {
48+
"target": "AppImage",
49+
"icon": "static/icon.png"
50+
},
51+
"generateUpdatesFilesForAllChannels": false
2152
},
2253
"dependencies": {
2354
"busylight": "^0.6.0",
@@ -36,41 +67,9 @@
3667
"socket.io": "^4.5.1"
3768
},
3869
"devDependencies": {
39-
"electron": "^26.1.0",
40-
"electron-builder": "^23.0.2",
41-
"np": "^7.5.0",
42-
"xo": "^0.39.1"
43-
},
44-
"xo": {
45-
"envs": [
46-
"node",
47-
"browser"
48-
]
49-
},
50-
"np": {
51-
"publish": false,
52-
"releaseDraft": false
53-
},
54-
"build": {
55-
"appId": "com.josephadams.beacon",
56-
"mac": {
57-
"category": "public.app-category.productivity",
58-
"darkModeSupport": true
59-
},
60-
"dmg": {
61-
"iconSize": 160,
62-
"contents": [
63-
{
64-
"x": 180,
65-
"y": 170
66-
},
67-
{
68-
"x": 480,
69-
"y": 170,
70-
"type": "link",
71-
"path": "/Applications"
72-
}
73-
]
74-
}
70+
"@electron/notarize": "^2.5.0",
71+
"electron": "^33.2.1",
72+
"electron-builder": "^25.1.8",
73+
"prettier": "^3.3.3"
7574
}
7675
}

0 commit comments

Comments
 (0)