maxim-lobanov / setup-xcode

Set up your GitHub Actions workflow with a specific version of Xcode
MIT License
280 stars 28 forks source link

Wrong Xcode version being selected #46

Closed atrinh0 closed 1 year ago

atrinh0 commented 1 year ago

Context: On GitHub Actions, the following Xcode versions are available:

https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode

Version Build Path
14.1 (beta) 14B5024h /Applications/Xcode_14.1.app
14.0.1 14A400 /Applications/Xcode_14.0.1.app
14.0 14A309 /Applications/Xcode_14.0.app

Setting the workflow file to the following:

    steps:
      - name: Setup Xcode version
        uses: maxim-lobanov/setup-xcode@v1.1
        with:
          xcode-version: 14.0

Results in the following:

Screenshot 2022-09-20 at 11 23 28
atrinh0 commented 1 year ago

I noticed the version I used is 2 years behind, will update to the latest to verify.

atrinh0 commented 1 year ago

The latest tagged version select Xcode 14.0.1 instead of 14.0 (as defined in the workflow file).

Screenshot 2022-09-20 at 11 33 08
atrinh0 commented 1 year ago

After reading the documentation the workflow file was adjusted to wrap the version in single quotes:

steps:
      - name: Setup Xcode version
        uses: maxim-lobanov/setup-xcode@v1.4.1
        with:
          xcode-version: '14.0'

Which produces the following results:

Screenshot 2022-09-20 at 11 39 02
BurakEmreGundes commented 1 year ago

i updated x-code version as 14.0 on Github action but this version didn't work for me.
Error: Could not find Xcode version that satisfied version spec: '14.0.1'

Screen Shot 2022-09-20 at 13 50 41

image
atrinh0 commented 1 year ago

i updated x-code version as 14.0 on Github action but this version didn't work for me. Error: Could not find Xcode version that satisfied version spec: '14.0.1'

Screen Shot 2022-09-20 at 13 50 41

image

https://github.com/actions/runner-images#available-images

macos-latest sets the image to macOS 11, which does not support Xcode 14.

maxim-lobanov commented 1 year ago

Hey @atrinh0 , I think the latest version of action (v1 tag) works as expected:

You might be confusing by the fact that 14.0 input selects 14.0.1 instead of 14.0 (14.0.0). But it is expected because this action provides semver notation for versions and 14.0 means 14.0.x. So 14.0.1 is selected instead of 14.0.0. I think you want to specify xcode-version: 14.0.0 for your use-case

@BurakEmreGundes, you have a different problem. Looks like you use macos-latest image label that still points to macos-11. You should use runs-on: macos-12 to use the image with latest Xcode versions.

atrinh0 commented 1 year ago

Thank you kindly for the information and prompt reply.