-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
I am using fastlane and chxcode, and they read Xcode's version from the .xcode-version file.
How about making this action read version from the file?
If it comes true, the '.xcode-version' file becomes SSOT, Single Source of Truth for the version of Xcode.
I think it could become a part of the best practice for iOS engineers.
Thanks.
jordanambra, nottmey, nordfogel, jupapios, simonbromberg and 11 more
Metadata
Metadata
Assignees
Labels
No labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
maxim-lobanov commentedon Feb 14, 2023
Hi 👋 ,
One possible problem that I see here is different syntax format.
This action uses semver notation. Fastlane docs describes the different notation (Gem::Version notation I guess?).
For example:
8.1will be resolved to8.1.0by fastlane and as8.1.*(for example8.1.2as latest available) in this action~> 8.1.0is not semver notation and won't work at all. And I guess some other differencesit can cause confusion and different selected Xcode. Correct me if I am wrong.
bobergj commentedon Feb 21, 2023
@maxim-lobanov:
I believe the idea of the
.xcode-versionfile comes from the (now defunct) fastlane ci project: https://github.com/fastlane/ci/blob/master/docs/xcode-version.md, and in the examples there only a plain version number string is allowed, not any match syntax such as~> 8.1.0.Also https://github.com/klaaspieter/chxcode, mentioned above, just matches on a plain string as far as I can see.
To alleviate this confusion, we could even add a (proposed) canonical description of the
.xcode-versionfile format to this repo. Especially so since is https://github.com/fastlane/ci/blob/master/docs/xcode-version.md is archived.I think we could see this as a bug in fastlane, and that
setup-xcodeis doing the right thing.Edit: we could also have
setup-xcodeoutput a warning to the github action log in this case.Related, there's also use of a
.swift-versionfile in the community, for example by SwiftFormat: https://github.com/nicklockwood/SwiftFormat/blob/master/README.md#swift-versionIt could be interesting to make
setup-xcodeselect an Xcode version based on.swift-versionif.xcode-versionisn't present.mplorentz commentedon Aug 15, 2023
FYI if you want to get this feature right now you can use @bobergj's fork. Replace
with
in your Github Actions workflow yaml.