diff --git a/apps/remixdesktop/afterbuild.js b/apps/remixdesktop/afterbuild.js index 0b377f7bdb..ef0085cfb4 100644 --- a/apps/remixdesktop/afterbuild.js +++ b/apps/remixdesktop/afterbuild.js @@ -1,18 +1,29 @@ const { spawn } = require('child_process'); exports.default = async function afterbuild(context) { + + // do not run when not on macOS + if (process.platform !== 'darwin') { + return; + } + console.log('AFTER BUILD', context); - const child = spawn('zsh', ['notarize.sh', 'arg1', 'arg2'], { shell: true }); - + + const artifactPaths = context.artifactPaths + const dmgs = artifactPaths.filter((dmg) => dmg.endsWith('.dmg')).map((dmg) => `'${dmg}'`) + console.log(['notarize.sh', ...dmgs]); + + const child = spawn('zsh', ['notarize.sh', ...dmgs], { shell: true }); + child.stdout.on('data', (data) => { console.log(`stdout: ${data}`); }); - + child.stderr.on('data', (data) => { console.error(`stderr: ${data}`); }); - + child.on('close', (code) => { console.log(`child process exited with code ${code}`); }); - + } diff --git a/apps/remixdesktop/notarize.sh b/apps/remixdesktop/notarize.sh index 481ad1b2fb..067658ec8e 100644 --- a/apps/remixdesktop/notarize.sh +++ b/apps/remixdesktop/notarize.sh @@ -8,17 +8,17 @@ xcrun notarytool store-credentials "notarytool-password" \ --team-id ${APPLE_TEAM_ID} \ --password ${APPLE_ID_PASSWORD} # Assuming your app is packaged as a dmg or zip for notarization -xcrun notarytool submit 'release/Remix IDE 2-0.0.11-Alpha.dmg' \ +xcrun notarytool submit "$1" \ --keychain-profile "notarytool-password" \ --wait # Assuming your app is packaged as a dmg or zip for notarization -xcrun notarytool submit 'release/Remix IDE 2-0.0.11-Alpha-Arm64.dmg' \ +xcrun notarytool submit "$2" \ --keychain-profile "notarytool-password" \ --wait -xcrun stapler staple 'release/Remix IDE 2-0.0.11-Alpha.dmg' -xcrun stapler staple 'release/Remix IDE 2-0.0.11-Alpha-Arm64.dmg' +xcrun stapler staple "$1" +xcrun stapler staple "$2" -spctl -a -t open -vvv --context context:primary-signature 'release/Remix IDE 2-0.0.11-Alpha.dmg' -spctl -a -t open -vvv --context context:primary-signature 'release/Remix IDE 2-0.0.11-Alpha-Arm64.dmg' \ No newline at end of file +spctl -a -t open -vvv --context context:primary-signature "$1" +spctl -a -t open -vvv --context context:primary-signature "$2" \ No newline at end of file