From b607782e37509ff7d007f4aa322b8573a2ffb76f Mon Sep 17 00:00:00 2001 From: Roni Castro Date: Sat, 4 Jan 2020 08:34:26 -0300 Subject: [PATCH] feat(ios): Added an `ios_build` job (#30 by @roni-castro) --- README.md | 11 +++++++ src/examples/full.yml | 10 ++++++ src/examples/ios.yml | 10 ++++++ src/jobs/ios_build.yml | 70 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 src/jobs/ios_build.yml diff --git a/README.md b/README.md index 50622bf..bb033a5 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,17 @@ workflows: requires: - build_android_release + + # Build the iOS app in release mode and do not run tests + - rn/ios_build: + name: build_ios_release + project_path: ios/Example.xcodeproj + device: "iPhone X" + build_configuration: Release + scheme: Example + requires: + - analyse_js + # Build and test the iOS app in release mode - rn/ios_build_and_test: project_path: "ios/Example.xcodeproj" diff --git a/src/examples/full.yml b/src/examples/full.yml index a962255..1f8c62d 100644 --- a/src/examples/full.yml +++ b/src/examples/full.yml @@ -84,6 +84,16 @@ usage: requires: - build_android_release + # Build the iOS app in release mode and do not run tests + - rn/ios_build: + name: build_ios_release + project_path: ios/Example.xcodeproj + device: "iPhone X" + build_configuration: Release + scheme: Example + requires: + - analyse_js + # Build and test the iOS app in release mode - rn/ios_build_and_test: project_path: "ios/Example.xcodeproj" diff --git a/src/examples/ios.yml b/src/examples/ios.yml index abe1f97..52464e0 100644 --- a/src/examples/ios.yml +++ b/src/examples/ios.yml @@ -58,6 +58,16 @@ usage: requires: - checkout_code + # Build the iOS app in release mode and do not run tests + - rn/ios_build: + name: build_ios_release + project_path: ios/Example.xcodeproj + device: "iPhone X" + build_configuration: Release + scheme: Example + requires: + - analyse_js + # Build and test the iOS app in release mode - rn/ios_build_and_test: project_path: "ios/Example.xcodeproj" diff --git a/src/jobs/ios_build.yml b/src/jobs/ios_build.yml new file mode 100644 index 0000000..a3f1ec9 --- /dev/null +++ b/src/jobs/ios_build.yml @@ -0,0 +1,70 @@ +description: Builds the iOS app at the given path with the given build scheme + +executor: macos + +parameters: + # For this job + checkout: + description: Boolean for whether or not to checkout as a first step. Default is false. + type: boolean + default: false + attach_workspace: + description: Boolean for whether or not to attach to an existing workspace. Default is true. + type: boolean + default: true + workspace_root: + description: Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory). + type: string + default: . + start_metro: + description: If we should start the Metro packager in the background for this job. + type: boolean + default: false + # For the iOS build command + project_type: + description: If the iOS app is built using a project file (*.xcodeproj) or a workspace. + type: enum + enum: ["project", "workspace"] + default: "project" + project_path: + description: The path to the Xcode project (*.xcodeproj) or the Xcode workspace (*.xcworkspace) that you want to build, relative to the root of the repository. + type: string + build_configuration: + description: The build configuration to use. This is normally either "Debug" or "Release" but you may have custom build configuration configured for your app. + type: string + default: "Debug" + derived_data_path: + description: The path to the directory to place the derived data, relative to the root of the repository. + type: string + default: "ios/build" + device: + description: The type of device you want to build for. + type: string + default: "iPhone X" + scheme: + description: The scheme to use. + type: string + +steps: + - when: + condition: <> + steps: + - checkout + - when: + condition: <> + steps: + - attach_workspace: + at: <> + - setup_macos_executor + - yarn_install + - when: + condition: <> + steps: + - metro_start + - ios_build: + project_path: <> + derived_data_path: <> + device: <> + build_configuration: <> + scheme: <> + project_type: <>