Skip to content
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

Move Fastlane to Project Root #15706

Merged
merged 26 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fc80c04
Move fastlane to the project root
jkmassel Jan 25, 2021
3397b7c
Update Tooling to use new paths
jkmassel Jan 30, 2021
b00b031
Fix translation builds
jkmassel Jan 30, 2021
71959eb
Pathing fix
jkmassel Feb 1, 2021
bb46c20
Use safe `system` calls
jkmassel Feb 1, 2021
32241c0
Ensure the PROJECT_ROOT_FOLDER is always correct
jkmassel Feb 1, 2021
868f344
Clean up `sh` usage
jkmassel Feb 1, 2021
42ad53a
Use proper path building for itc lane
jkmassel Feb 1, 2021
9ecb9f5
Better path safety in Swift, too
jkmassel Feb 1, 2021
38c660e
Ensure ENV[“PROJECT_ROOT”FOLDER”] is set
jkmassel Feb 2, 2021
7f6cded
Selectively delete translation files
jkmassel Feb 3, 2021
f090c57
Keep the output of `update-translations.rb` quiet
jkmassel Feb 3, 2021
b15122e
Align local output paths to the `Artifacts` dir
jkmassel Feb 3, 2021
bf2ccf6
Update .gitignore pathing
jkmassel Feb 3, 2021
6ba7874
Merge branch 'release/16.7' into move/fastlane
jkmassel Feb 8, 2021
99c53c1
Improve curl error handling
jkmassel Feb 11, 2021
9c5e87d
Explain the really strange escape sequence
jkmassel Feb 11, 2021
8efddd9
Fix parens
jkmassel Feb 11, 2021
d76a8e6
Remove promo screenshots
jkmassel Feb 11, 2021
d9e55ae
Delete files that should’ve been ignored
jkmassel Feb 11, 2021
e2f41e5
Remove fastlane-specific .gitignore file
jkmassel Feb 11, 2021
6848df3
Fix indentation weirdness
jkmassel Feb 11, 2021
821f074
More spacing fixes
jkmassel Feb 11, 2021
574dbe3
Another indentation fix
jkmassel Feb 11, 2021
911537f
Fix ruby error
jkmassel Feb 11, 2021
6f0d189
Don’t delete strings
jkmassel Feb 11, 2021
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
14 changes: 3 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,28 +228,20 @@ jobs:
- run:
name: Install other tools
command: |
brew unlink python@2
brew install imagemagick
brew install ghostscript
curl -sL https://sentry.io/get-cli/ | bash
- run:
name: Build
working_directory: Scripts
command: |
orig_version=`cat ../config/Version.internal.xcconfig | grep VERSION_SHORT | cut -d'=' -f2`
sed -i '' "$(awk '/^VERSION_SHORT/{ print NR; exit }' "../config/Version.internal.xcconfig")s/=.*/="${orig_version}"-`date +"%Y%d%m"`-"${CIRCLE_BUILD_NUM}"/" "../config/Version.internal.xcconfig"
bundle exec fastlane build_for_translation_review
orig_version=`cat config/Version.internal.xcconfig | grep VERSION_SHORT | cut -d'=' -f2`
sed -i '' "$(awk '/^VERSION_SHORT/{ print NR; exit }' "config/Version.internal.xcconfig")s/=.*/="${orig_version}"-`date +"%Y%d%m"`-"${CIRCLE_BUILD_NUM}"/" "config/Version.internal.xcconfig"
jkmassel marked this conversation as resolved.
Show resolved Hide resolved

VERSION_NAME="all-lang-build-${CIRCLE_BUILD_NUM}"
echo "export VERSION_NAME=$VERSION_NAME" >> $BASH_ENV

mkdir -p ../Artifacts
mv /var/tmp/Debug-iphonesimulator/WordPress.zip "../Artifacts/WordPress-${VERSION_NAME}.zip"
bundle exec fastlane build_for_translation_review version_name:$VERSION_NAME
no_output_timeout: 60m
- run:
name: Upload APP
command: |
curl --http1.1 https://${APPET_TOKEN}@api.appetize.io/v1/apps/${APPET_APPID} -F "file=@Artifacts/WordPress-${VERSION_NAME}.zip" -F "platform=ios"
- store_artifacts:
path: Artifacts
destination: Artifacts
Expand Down
48 changes: 35 additions & 13 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -469,30 +469,52 @@ import "./ScreenshotFastfile"
# This lane builds the app with pending translations for reviewers
# -----------------------------------------------------------------------------------
# Usage:
# bundle exec fastlane build_for_translation_review
# bundle exec fastlane build_for_translation_review version_name:1234
#
# Example:
# bundle exec fastlane build_for_translation_review
# bundle exec fastlane build_for_translation_review version_name:1234
#####################################################################################
desc "Builds and uploads for translation review"
lane :build_for_translation_review do | options |
ios_build_preflight() unless (options[:skip_prechecks])

sh("cd ../.. && ./Scripts/update-translations.rb review current")
sh("cd ../.. && ./Scripts/update-translations.rb review waiting")
sh("cd ../.. && ./Scripts/update-translations.rb review fuzzy")
puts "Building version: #{options[:version_name]}"

ios_merge_translators_strings(strings_folder:"../WordPress/Resources/")
sh("cd ../.. && ./Scripts/extract-framework-translations.swift")
update_translations_script_path = File.join( PROJECT_ROOT_FOLDER, 'Scripts', 'update-translations.rb' )
sh("#{update_translations_script_path} review current")
sh("#{update_translations_script_path} review waiting")
sh("#{update_translations_script_path} review fuzzy")
AliSoftware marked this conversation as resolved.
Show resolved Hide resolved

xcbuild(
workspace: "../WordPress.xcworkspace",
scheme: "WordPress",
configuration: "Debug",
xcargs: "-sdk iphonesimulator SYMROOT='/var/tmp/'"
ios_merge_translators_strings(strings_folder: File.join( PROJECT_ROOT_FOLDER, "WordPress", "Resources"))

extract_framework_translations_script_path = File.join( File.join( PROJECT_ROOT_FOLDER, "Scripts", "extract-framework-translations.swift"))
sh("#{extract_framework_translations_script_path}")

gym(
clean: true,
workspace: WORKSPACE_PATH,
scheme: "WordPress",
configuration: "Debug",
derived_data_path: DERIVED_DATA_PATH,
skip_package_ipa: true,
skip_archive: true,
destination: "generic/platform=iOS Simulator",
)

zip(path: "/var/tmp/Debug-iphonesimulator/WordPress.app", output_path: "/var/tmp/Debug-iphonesimulator/WordPress.zip")
FileUtils.mkdir_p(File.join(PROJECT_ROOT_FOLDER, "Artifacts"))

build_path = File.join(DERIVED_DATA_PATH, "Build", "Products", "Debug-iphonesimulator", "WordPress.app")
output_path = File.join(PROJECT_ROOT_FOLDER, "Artifacts", "WordPress-#{options[:version_name]}.zip")

# Appetize.io expects the `.app` bundle to be wrapped in a `.zip` file
zip(path: build_path, output_path: output_path)

# Upload the app to Appetize.io
appetize(
path: output_path,
api_token: ENV["APPET_TOKEN"],
public_key: "u33365457th0bw8wga7x856a8r"
)
end

desc "Build for Testing"
Expand Down