Skip to content

Commit

Permalink
feat: Use Node 10 by default (react-native-community#37 by @roni-castro)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Node 10 is now the default version. The previous default of Node 8 is now end-of-life. Most users will have no issues with upgrading unless they use modules which rely on Node 8 behaviour. You can also now use the `node_version` parameter to set the Node version you require.
  • Loading branch information
roni-castro authored and matt-oakes committed Jan 26, 2020
1 parent d809b2f commit 3e7efc6
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
paths: .
publish:
docker:
- image: circleci/node:8
- image: circleci/node:12
environment:
- PATH: '~/bin:/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
steps:
Expand Down
10 changes: 8 additions & 2 deletions src/commands/setup_macos_executor.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
description: Installs the required packages to build and test Android and iOS applications on the MacOS executor. You need to run this before running any other command on those executors.

parameters:
node_version:
description: The version of Node to use. This can be either a major version ("8"), a major and minor ("8.4"), or a fully qualified version ("8.4.1").
type: string
default: '10'

steps:
- run:
name: Configure Environment Variables
command: |
echo 'export PATH="$PATH:/usr/local/opt/node@8/bin:~/.yarn/bin:~/project/node_modules/.bin:~/project/example/node_modules/.bin"' >> $BASH_ENV
echo 'export PATH="$PATH:/usr/local/opt/node@<<parameters.node_version>>/bin:~/.yarn/bin:~/project/node_modules/.bin:~/project/example/node_modules/.bin"' >> $BASH_ENV
echo 'export ANDROID_HOME="/usr/local/share/android-sdk"' >> $BASH_ENV
echo 'export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"' >> $BASH_ENV
echo 'export PATH="$ANDROID_SDK_ROOT/emulator:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH"' >> $BASH_ENV
Expand All @@ -21,7 +27,7 @@ steps:
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/cask >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@8 >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@<<parameters.node_version>> >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install android-sdk >/dev/null
touch .watchmanconfig
Expand Down
6 changes: 5 additions & 1 deletion src/examples/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ usage:
# Custom jobs which are not part of the Orb
jobs:
checkout_code:
executor: rn/linux_js
executor:
name: rn/linux_js
node_version: '10'
steps:
- checkout
- persist_to_workspace:
Expand Down Expand Up @@ -87,6 +89,7 @@ usage:
# Build the iOS app in release mode and do not run tests
- rn/ios_build:
name: build_ios_release
node_version: '10'
project_path: ios/Example.xcodeproj
device: "iPhone X"
build_configuration: Release
Expand All @@ -96,6 +99,7 @@ usage:

# Build and test the iOS app in release mode
- rn/ios_build_and_test:
node_version: '10'
project_path: "ios/Example.xcodeproj"
device: "iPhone X"
build_configuration: "Release"
Expand Down
2 changes: 1 addition & 1 deletion src/executors/linux_js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parameters:
node_version:
description: The version of Node to use. This can be either a major version ("8"), a major and minor ("8.4"), or a fully qualified version ("8.4.1").
type: string
default: '8'
default: '10'
resource_class:
description: Changes the resource class of the executor. Requires a support request to enable the resource_class parameter. See https://circleci.com/docs/2.0/configuration-reference/#resource_class
type: string
Expand Down
8 changes: 7 additions & 1 deletion src/jobs/android_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ parameters:
description: A custom command to run right after yarn install.
type: string
default: ""
# For macos executor
node_version:
description: The version of Node to use. This can be either a major version ("8"), a major and minor ("8.4"), or a fully qualified version ("8.4.1").
type: string
default: '10'

steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- setup_macos_executor
- setup_macos_executor:
node_version: <<parameters.node_version>>
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
Expand Down
8 changes: 7 additions & 1 deletion src/jobs/ios_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ parameters:
description: A custom command to run right after yarn install.
type: string
default: ""
# For macos executor
node_version:
description: The version of Node to use. This can be either a major version ("8"), a major and minor ("8.4"), or a fully qualified version ("8.4.1").
type: string
default: '10'

steps:
- when:
Expand All @@ -59,7 +64,8 @@ steps:
steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- setup_macos_executor
- setup_macos_executor:
node_version: <<parameters.node_version>>
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
Expand Down
8 changes: 7 additions & 1 deletion src/jobs/ios_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ parameters:
description: A custom command to run right after yarn install.
type: string
default: ""
# For macos executor
node_version:
description: The version of Node to use. This can be either a major version ("8"), a major and minor ("8.4"), or a fully qualified version ("8.4.1").
type: string
default: '10'

steps:
- when:
Expand All @@ -69,7 +74,8 @@ steps:
steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- setup_macos_executor
- setup_macos_executor:
node_version: <<parameters.node_version>>
- ios_simulator_start:
device: <<parameters.device>>
- yarn_install
Expand Down

0 comments on commit 3e7efc6

Please sign in to comment.