Skip to content

Commit

Permalink
fix: update electron builder config
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Apr 2, 2024
1 parent 2278de8 commit 1a80a46
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 23 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
# macOS notarization API key
APPLEID: ${{ secrets.APPLEID }}
APPLEIDPASS: ${{ secrets.APPLEIDPASSWORD }}
APPLETEAMID: ${{ secrets.APPLETEAMID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SIGN: true
run: |
Expand Down
1 change: 1 addition & 0 deletions electron-builder.json5
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"default"
]
},
"afterSign": "scripts/notarize.cjs",
"win": {
"target": [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"cbor2": "^1.2.2",
"date-fns": "^3.3.1",
"electron": "^28.2.2",
"electron-builder": "^24.9.1",
"electron-builder": "24.13.3",
"electron-devtools-installer": "^3.2.0",
"electron-updater": "^6.1.8",
"element-plus": "^2.5.5",
Expand Down
11 changes: 3 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 3 additions & 14 deletions scripts/notarize.js → scripts/notarize.cjs
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
require('dotenv').config()
import { notarize } from '@electron/notarize'
const { notarize } = require('@electron/notarize')

exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context

// skip notarization for no macOS platforms
if (electronPlatformName !== 'darwin') {
return
}

// Skip notarization when SIGN env is false
if (
!process.env.SIGN ||
process.env.SIGN === 'false' ||
process.env.SIGN === '0'
) {
return
}

const appName = context.packager.appInfo.productFilename

return await notarize({
appBundleId: 'io.witnet.sheikah',
tool: 'notarytool',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
teamId: process.env.APPLETEAMID,
})
}

0 comments on commit 1a80a46

Please sign in to comment.