-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
103 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
language: objective-c | ||
osx_image: xcode11.3 | ||
language: objective-c | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
before_script: | ||
- ./scripts/add-key.sh | ||
- scripts/add-key.sh | ||
|
||
script: | ||
- xcodebuild -project PostgreSQL.xcodeproj -scheme PostgreSQL -configuration Release -derivedDataPath ./build -archivePath ./build/Products/PostgreSQL.xcarchive | ||
- xcodebuild -project PostgreSQL.xcodeproj -scheme PostgreSQL -configuration Release -derivedDataPath ./build OTHER_CODE_SIGN_FLAGS='--timestamp' build | ||
|
||
before_deploy: | ||
- export POSTGRES_PREFS_NAME="PostgresPrefs-${TRAVIS_TAG}" | ||
- scripts/notarize.sh | ||
|
||
deploy: | ||
provider: releases | ||
api_key: $GITHUB_TOKEN | ||
email: info@macca.tech | ||
file: build/${POSTGRES_PREFS_NAME}.dmg | ||
skip_cleanup: true | ||
overwrite: true | ||
draft: true | ||
on: | ||
repo: MaccaTech/PostgresPrefs | ||
branch: master | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env bash | ||
|
||
DMG_DIR="./build/$POSTGRES_PREFS_NAME" | ||
DMG="$DMG_DIR.dmg" | ||
|
||
# Reset | ||
rm -rf "$DMG_DIR" | ||
rm -f "$DMG" | ||
|
||
# Code sign | ||
mkdir -p "$DMG_DIR" | ||
cp -R ./build/Build/Products/Release/PostgreSQL.prefPane "$DMG_DIR" | ||
echo | ||
echo "Creating $DMG ..." | ||
hdiutil create -srcfolder "$DMG_DIR" "$DMG" | ||
codesign --sign "Developer ID Application: Macca Tech Ltd" "$DMG" | ||
|
||
# Notarize | ||
echo | ||
echo "Notarizing $DMG ..." | ||
response=`xcrun altool --notarize-app --primary-bundle-id "com.maccatech.PostgresPrefs" --username "info@maccatech.com" --password "$NOTARIZE_PASSWORD" --file "$DMG"` | ||
echo $response | ||
|
||
# Extract UUID | ||
uuid=`echo "$response" | sed -nE 's/RequestUUID[[:space:]]*\=[[:space:]]*([[:alnum:]_]*)/\1/p'` | ||
if [ -z "$uuid" ]; then | ||
echo "ERROR: RequestUUID not found" | ||
exit 1 | ||
fi | ||
|
||
# Poll until finished | ||
interval=20 | ||
((start_time=${SECONDS})) | ||
((end_time=${SECONDS}+3600)) | ||
|
||
while ((${SECONDS} < ${end_time})) | ||
do | ||
elapsed=`printf '%0.1f\n' $(bc <<<"scale=1; (${SECONDS}-$start_time)/60")` | ||
echo | ||
echo "Checking $uuid ($elapsed minutes) ..." | ||
if response=`xcrun altool -u "info@maccatech.com" -p "$NOTARIZE_PASSWORD" --notarization-info "$uuid"`; then | ||
statusCode=`echo "$response" | sed -nE 's/.*Status[[:space:]]*Code[[:space:]]*\:[[:space:]]*([[:digit:]]+).*/\1/p'` | ||
echo "$response" | grep -i "tatus" | ||
if [ -n "$statusCode" ]; then | ||
break | ||
fi | ||
else | ||
break | ||
fi | ||
sleep ${interval} | ||
done | ||
|
||
if [[ statusCode -ne "0" ]]; then | ||
echo "Notarization failed" | ||
echo "$response" | ||
exit 1 | ||
fi | ||
|
||
# Print out notarization check | ||
echo | ||
echo "Checking $DMG ..." | ||
spctl -a -t install --context context:primary-signature -v "$DMG" |