Skip to content

Commit

Permalink
chore: abort build on notarization failure
Browse files Browse the repository at this point in the history
  • Loading branch information
siepra committed Nov 17, 2023
1 parent 1b8c526 commit db291cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.MAC_CSC_LINK }}
APPLEID: ${{ secrets.APPLE_ID }}
APPLEIDPASS: ${{ secrets.APPLE_ID_PASS }}
APPLETEAMID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
USE_HARD_LINKS: false
Expand Down
31 changes: 14 additions & 17 deletions packages/desktop/scripts/notarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,23 @@
const { notarize } = require('@electron/notarize')

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

if (electronPlatformName !== 'darwin' || process.env.IS_E2E) {
console.log('skipping notarization')
return
}

const appName = context.packager.appInfo.productFilename
console.log('notarization start')
try {
const response = await notarize({
tool: 'notarytool',
appBundleId: 'com.yourcompany.yourAppId',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
teamId: process.env.APPLETEAMID
})
console.log('notarization done')
return response
} catch (e) {
console.error(e)
}
console.log('notarization started')

const response = await notarize({
tool: 'notarytool',
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASS,
teamId: process.env.APPLE_TEAM_ID
})

console.log('notarization done')

return response
}

0 comments on commit db291cb

Please sign in to comment.