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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [1.4.0](https://github.com/react-native-community/react-native-circleci-orb/compare/v1.3.0...v1.4.0) (2020-01-04)


### Features

* **ios:** Added an `ios_build` job ([#30](https://github.com/react-native-community/react-native-circleci-orb/issues/30) by [@roni-castro](https://github.com/roni-castro)) ([b607782](https://github.com/react-native-community/react-native-circleci-orb/commit/b607782))

# [1.3.0](https://github.com/react-native-community/react-native-circleci-orb/compare/v1.2.1...v1.3.0) (2019-11-20)


Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-community/circleci-orb",
"version": "1.3.0",
"version": "1.4.0",
"private": true,
"description": "A CircleCI Orb which can be used to simplify building and testing React Native apps.",
"scripts": {
Expand Down
10 changes: 10 additions & 0 deletions src/examples/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions src/examples/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions src/jobs/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ parameters:
description: The build type to build. This is normally either "debug" or "release" but you may have custom build types configured for your app.
type: string
default: "debug"
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""

steps:
- when:
Expand All @@ -45,6 +49,12 @@ steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
steps:
- run:
name: "on_after_initialize"
command: <<parameters.on_after_initialize>>
- android_build:
project_path: <<parameters.project_path>>
build_type: <<parameters.build_type>>
Expand Down
14 changes: 14 additions & 0 deletions src/jobs/android_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,26 @@ parameters:
type: enum
enum: ["fatal", "error", "warn", "info", "verbose", "trace"]
default: warn
on_after_initialize:
description: Set this to true if you want to run a custom shell command right after yarn install. Provide the command in on_after_initialize_command
type: boolean
default: false
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""

steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- setup_macos_executor
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
steps:
- run:
name: "on_after_initialize"
command: <<parameters.on_after_initialize>>
- when:
condition: <<parameters.start_metro>>
steps:
Expand Down
80 changes: 80 additions & 0 deletions src/jobs/ios_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
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
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""

steps:
- when:
condition: <<parameters.checkout>>
steps:
- checkout
- when:
condition: <<parameters.attach_workspace>>
steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- setup_macos_executor
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
steps:
- run:
name: "on_after_initialize_command by user"
command: <<parameters.on_after_initialize_command>>
- when:
condition: <<parameters.start_metro>>
steps:
- metro_start
- ios_build:
project_path: <<parameters.project_path>>
derived_data_path: <<parameters.derived_data_path>>
device: <<parameters.device>>
build_configuration: <<parameters.build_configuration>>
scheme: <<parameters.scheme>>
project_type: <<parameters.project_type>>
10 changes: 10 additions & 0 deletions src/jobs/ios_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ parameters:
type: enum
enum: ["fatal", "error", "warn", "info", "verbose", "trace"]
default: warn
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""

steps:
- when:
Expand All @@ -69,6 +73,12 @@ steps:
- ios_simulator_start:
device: <<parameters.device>>
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
steps:
- run:
name: "on_after_initialize_command by user"
command: <<parameters.on_after_initialize_command>>
- when:
condition: <<parameters.start_metro>>
steps:
Expand Down