-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
53 lines (46 loc) · 1.51 KB
/
action.yml
File metadata and controls
53 lines (46 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Select Xcode
description: Composite action to select a specific Xcode version.
branding:
icon: code
color: blue
inputs:
xcode-version:
description: The version of Xcode to select
default: ""
required: false
runs:
using: composite
steps:
- name: Set XCODE_VERSION to input value
shell: bash
if: ${{ inputs.xcode-version != '' }}
env:
INPUT_XCODE_VERSION: ${{ inputs.xcode-version }}
run: |
echo "XCODE_VERSION=${INPUT_XCODE_VERSION}" >> "$GITHUB_ENV"
- name: Check file existence
shell: bash
id: check_file
run: |
if [ -f ".xcode-version" ]; then
echo "xcode-version-file-exists=1" >> "$GITHUB_OUTPUT"
else
echo "xcode-version-file-exists=0" >> "$GITHUB_OUTPUT"
fi
- name: Set XCODE_VERSION to .xcode-version value
shell: bash
if: ${{ inputs.xcode-version == '' && steps.check_file.outputs.xcode-version-file-exists == '1' }}
run: |
echo "XCODE_VERSION=$(tr -d '[:space:]' < .xcode-version)" >> "$GITHUB_ENV"
- name: Assert XCODE_VERSION env var is defined
shell: bash
run: |
if [ -z "${XCODE_VERSION}" ]; then
echo "Version of Xcode should be defined as input to the action, in .xcode-version or set as XCODE_VERSION env var." >&2
exit 1
fi
- name: Select Xcode
shell: bash
run: |
sudo xcode-select -s "/Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer"
xcodebuild -version