-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WCiOS: Update Fastfile with version model #10807
Conversation
@@ -1219,10 +1295,62 @@ def inject_buildkite_analytics_environment(xctestrun_path:) | |||
File.write(xctestrun_path, Plist::Emit.dump(xctestrun)) | |||
end | |||
|
|||
# Returns the version of the app based on the specified xcconfig file | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# bundle exec fastlane build_and_upload_beta skip_confirm:true | ||
##################################################################################### | ||
desc 'Builds and uploads for distribution' | ||
lane :build_and_upload_beta do |options| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After searching the release scenario, Buildkite scripts, and Buildkite pipelines, I did not find any instances of this lane being used.
# bundle exec fastlane build_and_upload_release skip_confirm:true | ||
##################################################################################### | ||
desc 'Builds and uploads for distribution' | ||
lane :build_and_upload_release do |options| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After searching the release scenario, Buildkite scripts, and Buildkite pipelines, I did not find any instances of this lane being used.
# Instanstiate versioning classes | ||
VERSION_CALCULATOR = Fastlane::Wpmreleasetoolkit::Versioning::MarketingVersionCalculator.new | ||
VERSION_FORMATTER = Fastlane::Wpmreleasetoolkit::Versioning::FourPartVersionFormatter.new | ||
BUILD_CODE_FORMATTER = Fastlane::Wpmreleasetoolkit::Versioning::FourPartBuildCodeFormatter.new | ||
VERSION_FILE = Fastlane::Wpmreleasetoolkit::Versioning::IOSVersionFile.new(xcconfig_path: PUBLIC_CONFIG_FILE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where the various version and build code formatters/calculators are instantiated to be used by the rest of the Fastfile.
fastlane/Fastfile
Outdated
# Ensure we use the latest version of the toolkit | ||
check_for_toolkit_updates unless is_ci || ENV['FASTLANE_SKIP_TOOLKIT_UPDATE_CHECK'] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this check to the top of the code_freeze
lane instead of before_all
. It hasn't been useful to have it run before every single lane during the course of a release.
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
|
@@ -542,7 +618,7 @@ platform :ios do | |||
archive_zip_path = File.join(File.dirname(Dir.pwd), 'WooCommerce.xarchive.zip') | |||
zip(path: lane_context[SharedValues::XCODEBUILD_ARCHIVE], output_path: archive_zip_path) | |||
|
|||
version = options[:beta_release] ? ios_get_build_version : app_version | |||
version = options[:beta_release] ? current_build_code : current_release_version | |||
create_release( | |||
repository: GITHUB_REPO, | |||
version:, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a value for this parameter here 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the Ruby 3 convention of not needing to include the argument if the name of the argument is the same as the name of the parameter.
@mokagio I've updated this one with the changes from WP/JPiOS, so it is ready to review again. |
Remove unneeded env vars from Fastfile
Co-authored-by: Gio Lodi <[email protected]>
Co-authored-by: Gio Lodi <[email protected]>
@mokagio Thank you for taking another look! Sorry, I thought I had already fixed most of those cases for WCiOS, but I think I was getting it mixed up with another app 🤪. All your comments are now addressed 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good. At this point, the best thing to do is to merge and see how we go on the next code freeze 👍
Summary
precheck
actions from the Release Toolkit were tightly coupled with the existing version methods. To simplify things with the new version model, I took the relevant snippets from the precheck actions and added them directly here. This is something that I've discussed with Olivier and Jeremy before in the context of "no one knows what the precheck actions do unless you dive deep down into the RT". These changes are somewhat opposite of DRY, but I think it's worth it for transparency. We may also decide in the future to create smaller actions that do more specific things versus the existing precheck and version bump actions that combine many disparate methods.Before Merging