Skip to content

Commit 740fe76

Browse files
observableobjectVincent Frascello
andauthored
Added setup-xcode and more descriptive console output. (#6)
* Added XCode selection and console outputs * Updated version of setup-xcode * Updated Readme. Co-authored-by: Vincent Frascello <vincent.frascello@detroitlabs.com>
1 parent c0d8f32 commit 740fe76

File tree

2 files changed

+41
-22
lines changed

2 files changed

+41
-22
lines changed

Readme.MD

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
# XCode-Deploy 1.3
1+
# XCode-Deploy 1.4
22
This action will archive, export, and upload your project or workspace to App Store Connect (TestFlight).
33
It is designed to run on a containerized VM, such as a GitHub Hosted Runner.
44
If self-hosting, some of these steps may be unnecessary or redundant.
55

66
## Inputs
77

8+
### `xcode-version`
9+
10+
The version of XCode to use, in SemVer. Default is latest stable release: `xcode-latest`. See also [setup-xcode][0].
11+
812
### `configuration`
913

10-
The configuration to archive. Default is `'Release`. See also `xcodebuild`'s `-configuration`.
14+
The configuration to archive. Default is `Release`. See also `xcodebuild`'s `-configuration`.
1115

1216
### `scheme`
1317

@@ -51,8 +55,9 @@ You can generate one of these by doing a local export in XCode and then copy it
5155
## Sample Usage
5256
```yml
5357
- name: Deploy
54-
uses: vfrascello/xcode-deploy@v1.3
58+
uses: vfrascello/xcode-deploy@v1.4
5559
with:
60+
xcode-version: '14.0'
5661
configuration: 'Release'
5762
scheme: 'MyScheme'
5863
path-to-export-options: 'ExportOptions.plist'
@@ -65,26 +70,29 @@ You can generate one of these by doing a local export in XCode and then copy it
6570
auth-key-p8: ${{ secrets.AUTH_KEY_P8 }}
6671
```
6772
68-
See [action.yml][0] for more details.
73+
See [action.yml][1] for more details.
6974
7075
## Contributions
7176
7277
This composite action was written by me, Vincent Frascello, but uses actions by other open-source contributors:
7378
74-
[Oliver Jones][1]
79+
[Maxim Lobanov][0]
80+
81+
[Oliver Jones][2]
7582
76-
[Florian Fried][2]
83+
[Florian Fried][3]
7784
78-
[Akio Jinsenji][3]
85+
[Akio Jinsenji][4]
7986
80-
[Github Actions Team][4]
87+
[Github Actions Team][5]
8188
8289
## License
83-
Any contributions made under this project will be governed by the [MIT License][5].
84-
85-
[0]: https://github.com/vfrascello/xcode-deploy/blob/main/action.yml
86-
[1]: https://github.com/orj
87-
[2]: https://github.com/ffried
88-
[3]: https://github.com/akiojin
89-
[4]: https://github.com/actions
90-
[5]: https://github.com/vfrascello/xcode-deploy/blob/main/LICENSE
90+
Any contributions made under this project will be governed by the [MIT License][6].
91+
92+
[0]: https://github.com/maxim-lobanov/setup-xcode
93+
[1]: https://github.com/vfrascello/xcode-deploy/blob/main/action.yml
94+
[2]: https://github.com/orj
95+
[3]: https://github.com/ffried
96+
[4]: https://github.com/akiojin
97+
[5]: https://github.com/actions
98+
[6]: https://github.com/vfrascello/xcode-deploy/blob/main/LICENSE

action.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ branding:
66
color: 'yellow'
77

88
inputs:
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
@@ -55,6 +59,7 @@ runs:
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

Comments
 (0)