Skip to content

Commit

Permalink
notarize
Browse files Browse the repository at this point in the history
  • Loading branch information
rsyncOSX committed Oct 23, 2018
1 parent 2b50b9c commit 2711557
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -5,6 +5,8 @@ release:
xcodebuild -derivedDataPath $(PWD) -configuration Release -scheme RsyncOSX
dmg:
xcodebuild -derivedDataPath $(PWD) -configuration Release -scheme rsyncosx-dmg
dmg-release:
xcodebuild -derivedDataPath $(PWD) -configuration Release -scheme rsyncosx-dmg-notarize
clean:
rm -Rf Build
rm -Rf ModuleCache.noindex
Expand Down
56 changes: 56 additions & 0 deletions RsyncOSX.xcodeproj/project.pbxproj
Expand Up @@ -19,6 +19,17 @@
name = "rsyncosx-dmg";
productName = "rsyncosx-dmg";
};
E9D63661217FB8EA004B634E /* rsyncosx-dmg-notarize */ = {
isa = PBXAggregateTarget;
buildConfigurationList = E9D63665217FB8EA004B634E /* Build configuration list for PBXAggregateTarget "rsyncosx-dmg-notarize" */;
buildPhases = (
E9D63664217FB8EA004B634E /* ShellScript */,
);
dependencies = (
);
name = "rsyncosx-dmg-notarize";
productName = "rsyncosx-dmg";
};
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -762,6 +773,10 @@
DevelopmentTeam = 93M47F4H9T;
ProvisioningStyle = Automatic;
};
E9D63661217FB8EA004B634E = {
DevelopmentTeam = 93M47F4H9T;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = A044927D1D658EE800B3CE17 /* Build configuration list for PBXProject "RsyncOSX" */;
Expand All @@ -779,6 +794,7 @@
targets = (
A04492811D658EE800B3CE17 /* RsyncOSX */,
E94FB2032124A8FE0007DCAF /* rsyncosx-dmg */,
E9D63661217FB8EA004B634E /* rsyncosx-dmg-notarize */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -809,6 +825,19 @@
shellPath = /bin/sh;
shellScript = "${SOURCE_ROOT}/RsyncOSX/Scripts/create-dmg.sh";
};
E9D63664217FB8EA004B634E /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "${SOURCE_ROOT}/RsyncOSX/Scripts/create-dmg-notarize.sh\n";
};
E9DF3E6D1F1B5F180055DB66 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -1156,6 +1185,24 @@
};
name = Release;
};
E9D63666217FB8EA004B634E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 93M47F4H9T;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
E9D63667217FB8EA004B634E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 93M47F4H9T;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand Down Expand Up @@ -1186,6 +1233,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
E9D63665217FB8EA004B634E /* Build configuration list for PBXAggregateTarget "rsyncosx-dmg-notarize" */ = {
isa = XCConfigurationList;
buildConfigurations = (
E9D63666217FB8EA004B634E /* Debug */,
E9D63667217FB8EA004B634E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = A044927A1D658EE800B3CE17 /* Project object */;
Expand Down
Expand Up @@ -9,6 +9,11 @@
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>rsyncosx-dmg copy.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>rsyncosx-dmg.xcscheme</key>
<dict>
<key>orderHint</key>
Expand Down
38 changes: 38 additions & 0 deletions RsyncOSX/Scripts/create-dmg-notarize.dmg
@@ -0,0 +1,38 @@
#!/bin/bash
set -euo pipefail

if [ "${CONFIGURATION}" != "Release" ]; then
echo "[SKIP] Not building an Release configuration, skipping DMG creation"
exit
fi

RSYNCOSX_DMG_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/RsyncOSX/Info.plist")
RSYNCOSX_DMG="${BUILT_PRODUCTS_DIR}/RsyncOSX-${RSYNCOSX_DMG_VERSION}.dmg"
RSYNCOSX_APP="${BUILT_PRODUCTS_DIR}/RsyncOSX.app"
RSYNCOSX_APP_RESOURCES="${RSYNCOSX_APP}/Contents/Resources"

CREATE_DMG="${SOURCE_ROOT}/3thparty/github.com/andreyvit/create-dmg/create-dmg"
STAGING_DIR="${BUILT_PRODUCTS_DIR}/staging/dmg"
STAGING_APP="${STAGING_DIR}/RsyncOSX.app"
DMG_TEMPLATE_DIR="${SOURCE_ROOT}/Scripts/Templates/DMG"
DEFAULT_IDENTITY=$(security find-identity -v -p codesigning | grep "Developer ID" | head -1 | cut -f 4 -d " " || true)

if [ -f "${RSYNCOSX_DMG}" ]; then
echo "-- RsyncOSX dmg already created"
echo " > ${RSYNCOSX_DMG}"
else
echo "-- Creating RsyncOSX dmg"
echo " > ${RSYNCOSX_DMG}"

${CREATE_DMG} \
--volname "RsyncOSX" \
--volicon "${RSYNCOSX_APP_RESOURCES}/AppIcon.icns" \
--background "${DMG_TEMPLATE_DIR}/background.png" \
--window-pos -1 -1 \
--window-size 480 540 \
--icon "RsyncOSX.app" 240 130 \
--hide-extension RsyncOSX.app \
--app-drop-link 240 380 \
${RSYNCOSX_DMG} \
${RSYNCOSX_APP}
fi

0 comments on commit 2711557

Please sign in to comment.