diff --git a/.circleci/config.yml b/.circleci/config.yml index 80bec64..70a073d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,6 +57,7 @@ jobs: echo "$2" | base64 --decode > "$1" } decodeToFile embedded.provisionprofile "${MAC_PROVISION_PROFILE}" + decodeToFile mas-dev.provisionprofile "${MAC_DEV_PROVISION_PROFILE}" decodeToFile code-to-learn-macos.p12 "${CSC_MACOS}" security -v create-keychain -p circleci circleci.keychain security -v default-keychain -s circleci.keychain @@ -194,6 +195,7 @@ commands: steps: - run: command: npm run dist + no_output_timeout: 30m # macOS notarization can take longer than the default 10 minutes environment: <<: *clear_context WIN_CSC_LINK: ~/codesign.pfx diff --git a/electron-builder.yaml b/electron-builder.yaml index b4c4a0f..fc32724 100644 --- a/electron-builder.yaml +++ b/electron-builder.yaml @@ -27,7 +27,7 @@ mas: icon: buildResources/ScratchDesktop.icns masDev: type: development - provisioningProfile: macDeveloperThisDevice.provisionprofile + provisioningProfile: mas-dev.provisionprofile win: icon: buildResources/ScratchDesktop.ico target: diff --git a/scripts/electron-builder-wrapper.js b/scripts/electron-builder-wrapper.js index 91b239b..077708f 100644 --- a/scripts/electron-builder-wrapper.js +++ b/scripts/electron-builder-wrapper.js @@ -7,6 +7,7 @@ */ const {spawnSync} = require('child_process'); +const fs = require('fs'); /** * Strip any code signing configuration (CSC) from a set of environment variables. @@ -91,6 +92,7 @@ const runBuilder = function (wrapperConfig, target) { * same time but doing so limits has unwanted side effects on both macOS and Windows (see function body). */ const calculateTargets = function (wrapperConfig) { + const masDevProfile = 'mas-dev.provisionprofile'; const availableTargets = { macAppStore: { name: 'mas', @@ -126,7 +128,11 @@ const calculateTargets = function (wrapperConfig) { // Seems like a bug in electron-builder... // Running the 'mas' build first means that its output is available while we wait for 'dmg' notarization. // Add macAppStoreDev here to test a MAS-like build locally. You'll need a Mac Developer provisioning profile. - // targets.push(availableTargets.macAppStoreDev); + if (fs.existsSync(masDevProfile)) { + targets.push(availableTargets.macAppStoreDev); + } else { + console.log(`skipping target "${availableTargets.macAppStoreDev.name}": ${masDevProfile} missing`); + } if (wrapperConfig.doSign) { targets.push(availableTargets.macAppStore); } else {