@@ -6,6 +6,10 @@ branding:
66 color : ' yellow'
77
88inputs :
9+ xcode-version :
10+ description : ' The version of XCode to use. Defaults to the latest stable version.'
11+ requred : false
12+ default : ' latest-stable'
913 configuration :
1014 description : ' Configuration (default: Release)'
1115 required : true
5559 CONFIGURATION : ${{ inputs.configuration }}
5660 PATH_TO_EXPORT_OPTIONS : ${{ inputs.path-to-export-options }}
5761 run : |
62+ echo "[XCode-Deploy]: Checking Input for invalid characters..."
5863 if [[ "$SCHEME" == ${SCHEME//[^a-zA-Z0-9_\.- ]/} ]] && \
5964 [[ "$CONFIGURATION" == ${CONFIGURATION//[^a-zA-Z0-9_\.- ]/} ]] && \
6065 [[ "$PATH_TO_EXPORT_OPTIONS" == ${PATH_TO_EXPORT_OPTIONS//^[a-zA-Z0-9](?:[a-zA-Z0-9 ._-]*[a-zA-Z0-9])?\.[a-zA-Z0-9_-]+$/} ]]; then
@@ -71,22 +76,25 @@ runs:
7176 - name : Determine File To Build
7277 shell : bash
7378 run : |
79+ echo "[XCode-Deploy]: Determining file to build..."
7480 if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" \
7581 && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; \
7682 else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
7783 file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
7884 echo "TYPE=$filetype_parameter" >> $GITHUB_ENV
7985 echo "FILE_TO_BUILD=$file_to_build" >> $GITHUB_ENV
8086 echo "PROJECT_NAME=$(echo "$file_to_build" | cut -f 1 -d '.')" >> $GITHUB_ENV
81- - name : Grab Default Scheme
87+ - name : Setup Scheme
8288 shell : bash
8389 run : |
90+ echo "[XCode-Deploy]: Searching for default Scheme..."
8491 if [ "${{ inputs.scheme }}" == "" ]; then
8592 scheme_list=$(xcodebuild -list -json | tr -d "\n")
8693 scheme=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
8794 echo $scheme | cat >scheme
88- echo Using default scheme: $scheme
95+ echo "[XCode-Deploy]: Using default scheme: $scheme..."
8996 else
97+ echo "[XCode-Deploy]: Using provided Scheme: ${{ inputs.scheme }}"
9098 scheme=${{ inputs.scheme }}
9199 fi
92100 echo "SCHEME=$scheme" >> $GITHUB_ENV
@@ -102,14 +110,14 @@ runs:
102110 with :
103111 base64 : ${{ inputs.app-store-provisioning-profile }}
104112 - name : Select Xcode
105- shell : bash
106- run : |
107- # needed until September 26 when 14 becomes default
108- sudo xcode-select --switch /Applications/Xcode_14.0.app
113+ uses : maxim-lobanov/setup-xcode@v1.4.1
114+ with :
115+ xcode-version : ' 14.0'
109116 - name : Increment Build Number
110117 shell : bash
111118 run : |
112119 if ${{ inputs.update-build }}; then
120+ echo "[XCode-Deploy]: Updating Build Number to commit depth..."
113121 count=`git rev-list --count HEAD`
114122 xcrun agvtool new-version -all $count
115123 fi
@@ -134,6 +142,7 @@ runs:
134142 - name : Export Xcode archive
135143 shell : bash
136144 run : |
145+ echo "[XCode-Deploy]: Exporting archive using xcodebuild..."
137146 xcodebuild -exportArchive -verbose \
138147 -sdk iphoneos \
139148 -archivePath ${{ github.workspace }}/${{ env.PROJECT_NAME }}.xcarchive \
@@ -144,10 +153,12 @@ runs:
144153 - name : Upload to App Store Connect
145154 shell : bash
146155 run : |
156+ echo "[XCode-Deploy]: Uploading archive using altool..."
147157 xcrun altool --upload-app -f ${{ github.workspace }}/${{ env.PROJECT_NAME }}.ipa -t iOS \
148158 --apiIssuer ${{ inputs.auth-key-issuer-id }} --apiKey ${{ inputs.auth-key-id }}
149159 - name : Cleanup
150160 shell : bash
151161 run : |
162+ echo "[XCode-Deploy]: Removing Keychain and private_keys folder..."
152163 security delete-keychain codesign.keychain
153164 rm -rf ${{ github.workspace }}/private_keys || true
0 commit comments