This action is intended to switch between pre-installed versions of Xcode for macOS images in GitHub Actions.
The list of all available versions can be found in runner-images repository.
| Argument | Description | Format |
|---|---|---|
xcode-version |
Specify the Xcode version to use | - latest or- latest-stable or- SemVer string or - <semver>-beta |
Notes:
latest-stablepoints to the latest stable version of Xcodelatestincludes beta releases that GitHub actions has installed- SemVer examples:
14,14.1,14.3.1,^14.3.0(find more examples in SemVer cheatsheet) -betasuffix after SemVer will only select among beta releases that GitHub actions has installed- If sets a specific version, wraps it to single quotes in YAML like
'12.0'to pass it as string because GitHub trimmes trailing.0from numbers - If the
xcode-versionargument is omitted, the version is read from the file.xcode-versionat the root of the repository xcode-versiondefaults tolatestwhen no argument or.xcode-versionfile is present.
Set the Xcode version based on the contents of the .xcode-version file:
jobs:
build:
runs-on: macos-latest
steps:
- uses: nomasystems/action-xcode-select@v0.2
Set the latest stable Xcode version:
jobs:
build:
runs-on: macos-latest
steps:
- uses: nomasystems/action-xcode-select@v0.2
with:
xcode-version: latest-stable
Set the latest Xcode version including beta releases:
jobs:
build:
runs-on: macos-latest
steps:
- uses: nomasystems/action-xcode-select@v0.2
with:
xcode-version: latest
Set the specific stable version of Xcode:
jobs:
build:
runs-on: macos-14
steps:
- uses: nomasystems/action-xcode-select@v0.2
with:
xcode-version: '15.4'
Set the specific beta version of Xcode:
jobs:
build:
runs-on: macos-14
steps:
- uses: nomasystems/action-xcode-select@v0.2
with:
xcode-version: '16.1-beta'
- Enumerates apps named
Xcode.*.appin the/Applicationsdirectory- The version information for each app version is parsed from its plist files
- The requested semantic version is matched against the available app versions
- Exports the environment variable
DEVELOPER_DIR(seeman xcode-select) with the path to the matched Xcode app
The scripts and documentation in this project are released under the MIT License