-
Notifications
You must be signed in to change notification settings - Fork 0
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
2 changed files
with
42 additions
and
10 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
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 |
---|---|---|
|
@@ -5,21 +5,31 @@ scheme=OrzMC | |
team_id=2N62934Y28 | ||
configuration=Release | ||
destination="generic/platform=macOS" | ||
|
||
git_repo_dir=$(git rev-parse --show-toplevel) | ||
derived_data_path="$git_repo_dir/DerivedData" | ||
build_dir=$git_repo_dir/build | ||
archive_path="$build_dir/$scheme.xcarchive" | ||
client_dir=$git_repo_dir/client | ||
|
||
export_options_plist=$client_dir/exportOptions.plist | ||
export_path=$client_dir | ||
export_app=$export_path/$scheme.app | ||
export_app_zip=$export_app.zip | ||
|
||
apple_id="[email protected]" | ||
app_specific_password="bbgb-nzuk-trqz-uzax" | ||
timeout_duration="5m" | ||
|
||
cd $client_dir | ||
|
||
<<<<<<< HEAD | ||
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES | ||
|
||
# Archive | ||
======= | ||
# archive | ||
>>>>>>> ac8a2790a110792888a955692180ac1609ef0031 | ||
xcrun xcodebuild archive \ | ||
-scheme $scheme \ | ||
-configuration $configuration \ | ||
|
@@ -51,7 +61,7 @@ if [ $? -ne 0 ]; then | |
exit -2 | ||
fi | ||
|
||
# Export | ||
# export | ||
xcrun xcodebuild \ | ||
-exportArchive \ | ||
-archivePath $archive_path \ | ||
|
@@ -70,10 +80,7 @@ if [ $? -ne 0 ]; then | |
exit -4 | ||
fi | ||
|
||
# Notary | ||
apple_id="[email protected]" | ||
app_specific_password="bbgb-nzuk-trqz-uzax" | ||
timeout_duration="1h" | ||
# notary | ||
xcrun notarytool submit \ | ||
--apple-id $apple_id \ | ||
--password $app_specific_password \ | ||
|
@@ -87,19 +94,44 @@ if [ $? -ne 0 ]; then | |
exit -5 | ||
fi | ||
|
||
# Staple | ||
# staple | ||
xcrun stapler staple $export_app | ||
if [ $? -ne 0 ]; then | ||
echo staple ticket failed! | ||
exit -6 | ||
fi | ||
|
||
# Recreate Zip for Distribution | ||
# recreate zip for distribution | ||
if [ -f $export_app_zip ]; then | ||
rm -f $export_app_zip | ||
fi | ||
ditto -c -k --sequesterRsrc --keepParent $export_app $export_app_zip | ||
version=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$export_app/Contents/Info.plist") | ||
short_version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$export_app/Contents/Info.plist") | ||
date=$(date +%Y%m%d_%H%M%S) | ||
app_dist_zip="$scheme_${short_version}_${version}_${date}.zip" | ||
ditto -c -k --sequesterRsrc --keepParent $export_app $app_dist_zip | ||
if [ $? -ne 0 ]; then | ||
echo create zip with staple ticket failed! | ||
exit -7 | ||
fi | ||
fi | ||
|
||
echo zip file for distribution of app: $app_dist_zip | ||
|
||
# sparkle sign | ||
|
||
# upload zip to github and create a release | ||
|
||
# clean up | ||
if [ -d $build_dir ]; then | ||
rm -rf $build_dir | ||
fi | ||
|
||
if [ -d $derived_data_path ]; then | ||
rm -rf $derived_data_path | ||
fi | ||
|
||
if [ -d $export_app ]; then | ||
rm -rf $export_app | ||
fi | ||
|
||
rm -f *.plist *.log |