Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ common_params:
repo: "automattic/woocommerce-ios/"
# Common environment values to use with the `env` key.
- &common_env
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
IMAGE_ID: xcode-14
Comment on lines +14 to 15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition 👍

In the past, I used dynamic pipelines, where instead of having an hardcoded YAML pipeline we'd run a script that generated the YAML at runtime. In that setup, we could read .xcode-version and generate the IMAGE_ID name based on it.

But, dynamic pipelines are harder to read, might have bugs in the generation logic, and we don't change Xcode versions that fast to justify the investment and tradeoff at this point in time.


# This is the default pipeline – it will build and test the app
Expand Down
1 change: 1 addition & 0 deletions .buildkite/release-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ common_params:
repo: "automattic/woocommerce-ios/"
# Common environment values to use with the `env` key.
- &common_env
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
IMAGE_ID: xcode-14

steps:
Expand Down
1 change: 1 addition & 0 deletions .xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
~> 14.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file we had before was .xcversion, but the file used by Fastlane's xcversion action is supposed to be named .xcode-version (by convention similar to files like .ruby-version and the like), not .xcversion, hence this file rename (in addition to updating its content to ~> 14.0).

1 change: 0 additions & 1 deletion .xcversion

This file was deleted.

18 changes: 12 additions & 6 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,11 @@ platform :ios do
lane :build_and_upload_itc do |options|
ensure_sentry_installed

ios_build_prechecks(skip_confirm: options[:skip_confirm], external: true) unless options[:skip_prechecks]
ios_build_preflight unless options[:skip_prechecks]
unless options[:skip_prechecks]
ios_build_prechecks(skip_confirm: options[:skip_confirm], external: true)
ios_build_preflight
xcversion() # Ensure we're using the right version of Xcode, defined in `.xcode-version` file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick. Have you considered wrapping xcversion() in a function to integrate the comment in the code? Something like check_xcode_version or enforce_xcode_version?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: I accidentally landed on this document that mentions xcode-install/xcversion has been deprecated and how to update to the new xcodes alternative.

Might be worth looking into before merging, or as an update followup.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or as an update followup.

I'd be happy to look into it if your plate's full.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh TIL this was deprecated. Yeah I'd love if you can take a look at migrating the command to xcodes. A bit unfortunate to see that it seems to require the installation of a separate tool tho, unlike xcversion

Copy link
Contributor Author

@AliSoftware AliSoftware Nov 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mokagio Seems latest fastlane shipped with official new usage of xcodes over xcversion: https://twitter.com/fastlanetools/status/1591561723794030592

end

appstore_code_signing

Expand Down Expand Up @@ -501,6 +504,7 @@ platform :ios do
desc 'Builds and uploads an installable build'
lane :build_and_upload_installable_build do
ensure_sentry_installed
xcversion() # Ensure we're using the right version of Xcode, defined in `.xcode-version` file

alpha_code_signing

Expand Down Expand Up @@ -577,6 +581,8 @@ platform :ios do
#####################################################################################
desc 'Build for Testing'
lane :build_for_testing do |options|
xcversion() # Ensure we're using the right version of Xcode, defined in `.xcode-version` file

run_tests(
workspace: 'WooCommerce.xcworkspace',
scheme: TEST_SCHEME,
Expand Down Expand Up @@ -649,8 +655,8 @@ platform :ios do
# Ensure we're using the latest Pods
sh('bundle exec pod install --verbose')

# Ensure we're using the right version of Xcode
xcversion(version: '~> 13.4')
# Ensure we're using the right version of Xcode, defined in `.xcode-version` file
xcversion()

scan(
workspace: 'WooCommerce.xcworkspace',
Expand All @@ -662,8 +668,8 @@ platform :ios do

desc 'Take Screenshots'
lane :take_screenshots do |options|
# Ensure we're using the right version of Xcode
xcversion(version: '~> 13.4')
# Ensure we're using the right version of Xcode, defined in `.xcode-version` file
xcversion()

# By default, clear previous screenshots
languages = IOS_LOCALES
Expand Down