Skip to content

Commit

Permalink
Use --notarize instead of --no-notarize in macos pack script
Browse files Browse the repository at this point in the history
for easy build release app to test
  • Loading branch information
jhen0409 committed Jul 21, 2023
1 parent 16a31be commit a17d399
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions scripts/mac/createUniversalApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { makeUniversalApp } = require('@electron/universal');
const { signAsync } = require('@electron/osx-sign');
const { notarize } = require('@electron/notarize');

const noNotarize = process.argv.includes('--no-notarize');
const isNotarizeNeeded = process.argv.includes('--notarize');

const developerId = `${process.env.APPLE_DEVELOPER_NAME} (${process.env.APPLE_TEAM_ID})`;

Expand All @@ -28,7 +28,7 @@ async function run() {
outAppPath: appPath,
});

if (noNotarize) return;
if (!isNotarizeNeeded) return;

const pathes = [appPath, x64AppPath, arm64AppPath];
for (const p of pathes) {
Expand Down
13 changes: 6 additions & 7 deletions scripts/package-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)")
echo "[v$PACKAGE_VERSION] Packaging darwin x64..."

# Check arg no-notarize
if [ "$1" == "--no-notarize" ]; then
echo "Notarization skipped."
NOTARIZE=0
if [ "$1" == "--notarize" ]; then
NOTARIZE=1
fi

if [ "$NOTARIZE" != "0" ]; then
if [ "$NOTARIZE" == "1" ]; then
if [ -z "$APPLE_DEVELOPER_NAME" ]; then
echo -e "Apple Developer Name: \c"
read APPLE_DEVELOPER_NAME
Expand Down Expand Up @@ -43,10 +42,10 @@ function build_with_arch() {
build_with_arch x64
build_with_arch arm64

if [ "$NOTARIZE" != "0" ]; then
node scripts/mac/createUniversalApp.js
if [ "$NOTARIZE" == "1" ]; then
node scripts/mac/createUniversalApp.js --notarize
else
node scripts/mac/createUniversalApp.js --no-notarize
node scripts/mac/createUniversalApp.js
fi

node scripts/mac/createDMG.js
Expand Down

0 comments on commit a17d399

Please sign in to comment.