From 6b9b36d6eeb6580142b57c3b6d7d5c0dd1d73230 Mon Sep 17 00:00:00 2001 From: Chad Sykes Date: Sun, 3 Jan 2021 15:02:29 -0700 Subject: [PATCH] Add a packageRelease.sh script to help automate the generation of release assets --- .gitignore | 2 ++ Scripts/export_options.plist | 8 ++++++++ Scripts/package_release.sh | 24 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 Scripts/export_options.plist create mode 100755 Scripts/package_release.sh diff --git a/.gitignore b/.gitignore index e27d315..18d371b 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,8 @@ DerivedData/ *.ipa *.dSYM.zip *.dSYM +Archive/* +Product/* ## Playgrounds timeline.xctimeline diff --git a/Scripts/export_options.plist b/Scripts/export_options.plist new file mode 100644 index 0000000..055f67c --- /dev/null +++ b/Scripts/export_options.plist @@ -0,0 +1,8 @@ + + + + + method + developer-id + + diff --git a/Scripts/package_release.sh b/Scripts/package_release.sh new file mode 100755 index 0000000..32b6432 --- /dev/null +++ b/Scripts/package_release.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# +# Package release +# +# This will build and archive the app and then compress it in a .zip file +# You must already have all required code signing assets installed on your computer + +PROJECT_NAME=Xcodes +PROJECT_DIR=$(pwd)/$PROJECT_NAME/Resources +SCRIPTS_DIR=$(pwd)/Scripts +INFOPLIST_FILE="Info.plist" + +CFBundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") +CFBundleShortVersionString=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") + +# Ensure a clean build +rm -rf Archive/* +rm -rf Product/* +xcodebuild clean -project $PROJECT_NAME.xcodeproj -configuration Release -alltargets + +# Archive the app and export for release distribution +xcodebuild archive -project $PROJECT_NAME.xcodeproj -scheme $PROJECT_NAME -archivePath Archive/$PROJECT_NAME.xcarchive +xcodebuild -archivePath Archive/$PROJECT_NAME.xcarchive -exportArchive -exportPath Product/$PROJECT_NAME.app -exportOptionsPlist "${SCRIPTS_DIR}/export_options.plist" +zip -r "Product/$PROJECT_NAME.v${CFBundleShortVersionString}.b${CFBundleVersion}.zip" Product/$PROJECT_NAME.app