signmacosdesktop
filip mertens 9 months ago
parent 44df523c6e
commit a072b67354
  1. 11
      .circleci/config.yml
  2. 16
      apps/remixdesktop/afterbuild.js
  3. 33
      apps/remixdesktop/notarizedmg.sh

@ -302,10 +302,15 @@ jobs:
cd apps/remixdesktop
yarn
yarn installRipGrepMacOXarm64
PUBLISH_FOR_PULL_REQUEST='true' USE_HARD_LINKS=false yarn dist --mac --arm64
PUBLISH_FOR_PULL_REQUEST='false' USE_HARD_LINKS=false yarn dist --mac --arm64
yarn installRipGrepMacOXx64
PUBLISH_FOR_PULL_REQUEST='true' USE_HARD_LINKS=false yarn dist --mac --x64
PUBLISH_FOR_PULL_REQUEST='false' USE_HARD_LINKS=false yarn dist --mac --x64
- run:
name: Notarize the app
command: |
sudo apt-get install jq
cd apps/remixdesktop
zsh notarizedmg.sh
- store_artifacts:
path: apps/remixdesktop/release/
destination: remixdesktop-mac

@ -1,4 +1,4 @@
const { spawn } = require('child_process');
const fs = require('fs');
exports.default = async function afterbuild(context) {
// do not run when not on macOS
@ -10,20 +10,8 @@ exports.default = async function afterbuild(context) {
const artifactPaths = context.artifactPaths
const dmgs = artifactPaths.filter((dmg) => dmg.endsWith('.dmg')).map((dmg) => `'${dmg}'`)
console.log(['notarize.sh', ...dmgs]);
fs.writeFileSync('dmgs.json', JSON.stringify({ dmgs }, null, 2))
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}`);
});
}

@ -0,0 +1,33 @@
#!/bin/bash
# Path to the JSON file containing the DMG paths
JSON_FILE="dmgs.json"
# Read the DMGs array from the JSON file
DMG_PATHS=$(jq -r '.dmgs[]' "$JSON_FILE")
xcrun notarytool store-credentials "notarytool-password" \
--apple-id ${APPLE_ID} \
--team-id ${APPLE_TEAM_ID} \
--password ${APPLE_ID_PASSWORD}
# Loop over the DMG paths
for DMG_PATH in $DMG_PATHS; do
# Remove single quotes from the path if present
DMG_PATH_CLEANED=$(echo $DMG_PATH | tr -d "'")
echo "Submitting $DMG_PATH_CLEANED for notarization..."
# Run your notarytool submit command here
# Ensure you replace `your-app-specific-args` with actual arguments for your app
notarytool submit "$DMG_PATH_CLEANED" --keychain-profile "notarytool-password" --wait
# Check for success/failure if necessary
if [ $? -eq 0 ]; then
echo "Successfully submitted $DMG_PATH_CLEANED for notarization."
else
echo "Failed to submit $DMG_PATH_CLEANED for notarization."
fi
done
echo "All DMG submissions completed."
Loading…
Cancel
Save