Skip to content

Commit b1eb2c9

Browse files
add support for xcode-version latest
1 parent 99ee4e8 commit b1eb2c9

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ inputs:
77
xcode-version:
88
description: The version of Xcode to use for building the Xcode project. Defaults to the active version of Xcode on the runner.
99
required: false
10+
default: latest
1011
project-path:
1112
description: The directory that contains the exported xcode project from Unity.
1213
required: true

dist/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60680,7 +60680,14 @@ const main = async () => {
6068060680
let xcodeVersionString = core.getInput('xcode-version');
6068160681
if (xcodeVersionString) {
6068260682
core.info(`Setting xcode version to ${xcodeVersionString}`);
60683-
await exec.exec('xcodes', ['select', xcodeVersionString]);
60683+
if (xcodeVersionString.includes('latest')) {
60684+
await exec.exec('xcodes', ['install', '--latest', '--select']);
60685+
await exec.exec('xcodebuild', ['-license accept']);
60686+
await exec.exec('xcodebuild', ['-runFirstLaunch']);
60687+
}
60688+
else {
60689+
await exec.exec('xcodes', ['select', xcodeVersionString]);
60690+
}
6068460691
}
6068560692
let xcodeVersionOutput = '';
6068660693
await exec.exec('xcodebuild', ['-version'], {

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ const main = async () => {
2222
let xcodeVersionString = core.getInput('xcode-version');
2323
if (xcodeVersionString) {
2424
core.info(`Setting xcode version to ${xcodeVersionString}`);
25-
await exec.exec('xcodes', ['select', xcodeVersionString]);
25+
if (xcodeVersionString.includes('latest')) {
26+
await exec.exec('xcodes', ['install', '--latest', '--select']);
27+
await exec.exec('xcodebuild', ['-license accept']);
28+
await exec.exec('xcodebuild', ['-runFirstLaunch']);
29+
} else {
30+
await exec.exec('xcodes', ['select', xcodeVersionString]);
31+
}
2632
}
2733
let xcodeVersionOutput = '';
2834
await exec.exec('xcodebuild', ['-version'], {

0 commit comments

Comments
 (0)