Skip to content

Instantly share code, notes, and snippets.

@jdan
Created August 23, 2019 22:04
Show Gist options
  • Save jdan/3c4e8686a69af0e7e1128df768cc19ff to your computer and use it in GitHub Desktop.
Save jdan/3c4e8686a69af0e7e1128df768cc19ff to your computer and use it in GitHub Desktop.
some electron signing stuff
#!/bin/sh
mkdir App.iconset
sips -z 16 16 Icon1024.png --out App.iconset/icon_16x16.png
sips -z 32 32 Icon1024.png --out App.iconset/[email protected]
sips -z 32 32 Icon1024.png --out App.iconset/icon_32x32.png
sips -z 64 64 Icon1024.png --out App.iconset/[email protected]
sips -z 128 128 Icon1024.png --out App.iconset/icon_128x128.png
sips -z 256 256 Icon1024.png --out App.iconset/[email protected]
sips -z 256 256 Icon1024.png --out App.iconset/icon_256x256.png
sips -z 512 512 Icon1024.png --out App.iconset/[email protected]
sips -z 512 512 Icon1024.png --out App.iconset/icon_512x512.png
cp Icon1024.png App.iconset/[email protected]
iconutil -c icns App.iconset
rm -R App.iconset
# npm version patch -m "Build %s"
VERSION=$(node -e "console.log(require('./package.json').version)")
electron-packager ./ Shade \
--platform=$PLATFORM \
--asar \
--icon=App.icns \
--ignore '^/src|\.sh$|\.provisionprofile$' \
--app-bundle-id=com.halogen.shade \
--app-version=$VERSION \
--build-version=1.0.3 \
--overwrite
# Delete all the language files
cd "Shade-$PLATFORM-x64/Shade.app/Contents/Resources"
rm -rf $(ls | grep "lproj" | grep -v "en\." | xargs)
cd ../../../../
# add these if you want to the test the signed MAS build
# ... provisions and all!
# --type=development \
# --provisioning-profile="embedded.provisionprofile" \
electron-osx-sign "Shade-$PLATFORM-x64/Shade.app" \
--entitlements=parent.entitlements \
--platform=$PLATFORM \
--verbose
electron-osx-flat "Shade-$PLATFORM-x64/Shade.app" \
--platform=$PLATFORM \
--verbose
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment