Skip to content

Commit

Permalink
Merge commit '6f7eae5c583090bd62ca60a4c3170445e5a0a751' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi committed Aug 23, 2024
2 parents 7361b16 + 6f7eae5 commit 4c16290
Show file tree
Hide file tree
Showing 2,683 changed files with 148,852 additions and 120,850 deletions.
14 changes: 11 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,23 @@ parameters:
default: false
type: boolean

release_latest:
run_nightly_workflow:
default: false
type: boolean

release_version:
default: "9999"
default: ""
type: string

run_nightly_workflow:
release_monorepo_packages_version:
default: ""
type: string

release_tag:
default: ""
type: string

release_dry_run:
default: false
type: boolean

Expand Down
8 changes: 6 additions & 2 deletions .circleci/configurations/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ commands:
- restore_cache:
key: *rbenv_cache_key
- run:
name: Bundle Install
name: Install the proper Ruby and run Bundle install
command: |
# Check if rbenv is installed. CircleCI is migrating to rbenv so we may not need to always install it.
Expand All @@ -58,8 +58,12 @@ commands:
# Set ruby dependencies
rbenv global << parameters.ruby_version >>
if [[ << parameters.ruby_version >> == "2.6.10" ]]; then
# RubyGems 3.0.3.1 breaks Bundler
gem update --system 3.2.3
rbenv rehash
gem install bundler -v 2.4.22
else
rbenv rehash
gem install bundler
fi
bundle check || bundle install --path vendor/bundle --clean
Expand Down Expand Up @@ -559,7 +563,7 @@ commands:
steps:
- run:
name: "Run Tests: iOS Unit and Integration Tests"
command: node ./scripts/circleci/run_with_retry.js 3 yarn test-ios
command: yarn test-ios
- run:
name: Zip Derived data folder
when: always
Expand Down
11 changes: 2 additions & 9 deletions .circleci/configurations/executors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ executors:
<<: *defaults
macos:
xcode: *xcode_version
resource_class: macos.x86.medium.gen2
resource_class: macos.m1.medium.gen1
environment:
- BUILD_FROM_SOURCE: true
reactnativeios-lts:
<<: *defaults
macos:
xcode: '14.3.1'
resource_class: macos.x86.medium.gen2
environment:
- BUILD_FROM_SOURCE: true
- RCT_BUILD_HERMES_FROM_SOURCE: true
151 changes: 91 additions & 60 deletions .circleci/configurations/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
executor: reactnativeios
parameters:
ruby_version:
default: "2.7.7"
default: "2.7.8"
description: The version of ruby that must be used
type: string
steps:
Expand Down Expand Up @@ -384,9 +384,9 @@ jobs:
destination: template-apk

# -------------------------
# JOBS: Test iOS Template
# JOBS: Test iOS HelloWorld
# -------------------------
test_ios_template:
test_ios_helloworld:
parameters:
flavor:
default: "Debug"
Expand All @@ -412,25 +412,18 @@ jobs:
default: "2.6.10"
description: The version of ruby that must be used
type: string
podfile_lock_path:
type: string
default: "/tmp/iOSTemplateProject/ios/Podfile.lock"
pods_build_folder:
type: string
default: "/tmp/iOSTemplateProject/ios/Pods"
podfile_lock_cache_key:
type: string
default: *template_podfile_lock_cache_key
default: *helloworld_podfile_lock_cache_key
cocoapods_cache_key:
type: string
default: *template_cocoapods_cache_key
default: *helloworld_cocoapods_cache_key
executor:
description: The executor to use
default: reactnativeios
type: string
executor: << parameters.executor >>
environment:
- PROJECT_NAME: "iOSTemplateProject"
- HERMES_WS_DIR: *hermes_workspace_root
- YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
Expand All @@ -451,48 +444,37 @@ jobs:
BUILD_TYPE="<< parameters.flavor >>"
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "export HERMES_ENGINE_TARBALL_PATH=$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME" >> $BASH_ENV
- run:
name: Create iOS template project
command: |
REPO_ROOT=$(pwd)
PACKAGE=$(cat build/react-native-package-version)
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$PATH_TO_PACKAGE\"}"
node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$REPO_ROOT/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose
- with_xcodebuild_cache:
podfile_lock_path: << parameters.podfile_lock_path >>
pods_build_folder: << parameters.pods_build_folder >>
podfile_lock_path: packages/helloworld/ios/Podfile.lock
pods_build_folder: packages/helloworld/ios/Pods
cocoapods_cache_key: << parameters.cocoapods_cache_key >>
podfile_lock_cache_key: << parameters.podfile_lock_cache_key >>
steps:
- run:
name: Install iOS dependencies - Configuration << parameters.flavor >>; New Architecture << parameters.architecture >>; JS Engine << parameters.jsengine>>
command: |
cd /tmp/$PROJECT_NAME/ios
if [[ << parameters.architecture >> == "NewArch" ]]; then
export RCT_NEW_ARCH_ENABLED=1
cd packages/helloworld
args=()
if [[ << parameters.architecture >> == "OldArch" ]]; then
args+=(--arch old)
fi
if [[ << parameters.jsengine >> == "JSC" ]]; then
export USE_HERMES=0
args+=(--jsvm jsc)
fi
if [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then
export USE_FRAMEWORKS=dynamic
args+=(--frameworks dynamic)
fi
cd ..
bundle install
bundle exec pod install --project-directory=ios
yarn bootstrap ios "${args[@]}" | cat
- run:
name: Build template project
name: Build helloworld project
command: |
xcodebuild build \
-configuration << parameters.flavor >> \
-workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \
-scheme $PROJECT_NAME \
-sdk iphonesimulator
cd packages/helloworld
args=()
if [[ << parameters.flavor >> == "Release" ]]; then
args+=(--prod)
fi
yarn build ios "${args[@]}" | cat
yarn bundle ios "${args[@]}" | cat
# -------------------------
# JOBS: Test iOS RNTester
Expand Down Expand Up @@ -599,7 +581,7 @@ jobs:
environment:
- HERMES_WS_DIR: *hermes_workspace_root
- HERMES_VERSION_FILE: "packages/react-native/sdks/.hermesversion"
- BUILD_FROM_SOURCE: true
- RCT_BUILD_HERMES_FROM_SOURCE: true
steps:
- run:
name: Install dependencies
Expand Down Expand Up @@ -780,7 +762,7 @@ jobs:
default: "iphoneos"
description: The Hermes Slice that this job has to build
type: enum
enum: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
enum: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
executor: reactnativeios
environment:
- HERMES_WS_DIR: *hermes_workspace_root
Expand Down Expand Up @@ -813,13 +795,19 @@ jobs:
exit 0
fi
export RELEASE_VERSION=$(cat /tmp/react-native-version)
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
export MAC_DEPLOYMENT_TARGET=10.13
BUILD_TYPE="<< parameters.flavor >>" ./utils/build-mac-framework.sh
unset MAC_DEPLOYMENT_TARGET
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
export IOS_DEPLOYMENT_TARGET=13.4
BUILD_TYPE="<< parameters.flavor >>" ./utils/build-ios-framework.sh "$SLICE"
unset IOS_DEPLOYMENT_TARGET
fi
unset RELEASE_VERSION
echo "Moving from build_$SLICE to $FINAL_PATH"
mv build_"$SLICE" "$FINAL_PATH"
Expand Down Expand Up @@ -879,6 +867,10 @@ jobs:
key: << parameters.slice_base_cache_key >>-iphonesimulator-<< parameters.flavor >>
- restore_cache:
key: << parameters.slice_base_cache_key >>-catalyst-<< parameters.flavor >>
- restore_cache:
key: << parameters.slice_base_cache_key >>-xros-<< parameters.flavor >>
- restore_cache:
key: << parameters.slice_base_cache_key >>-xrsimulator-<< parameters.flavor >>
- run:
name: "Move back build folders"
command: |
Expand All @@ -887,6 +879,8 @@ jobs:
mv build_iphoneos_<< parameters.flavor >> build_iphoneos
mv build_iphonesimulator_<< parameters.flavor >> build_iphonesimulator
mv build_catalyst_<< parameters.flavor >> build_catalyst
mv build_xros_<< parameters.flavor >> build_xros
mv build_xrsimulator_<< parameters.flavor >> build_xrsimulator
- run:
name: "Prepare destroot folder"
command: |
Expand All @@ -898,7 +892,11 @@ jobs:
command: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
export IOS_DEPLOYMENT_TARGET=13.4
export RELEASE_VERSION=$(cat /tmp/react-native-version)
./utils/build-ios-framework.sh build_framework
unset RELEASE_VERSION
unset IOS_DEPLOYMENT_TARGET
- run:
name: Package the Hermes Apple frameworks
command: |
Expand Down Expand Up @@ -933,6 +931,8 @@ jobs:
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
cd ./packages/react-native/sdks/hermes || exit 1
Expand All @@ -941,6 +941,8 @@ jobs:
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
Expand Down Expand Up @@ -1025,7 +1027,7 @@ jobs:
name: Build HermesC for Windows
command: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7 -y
choco install --no-progress cmake -y
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
Expand Down Expand Up @@ -1076,36 +1078,65 @@ jobs:
# -------------------------
# JOBS: Releases
# -------------------------
prepare_package_for_release:

# Writes a new commit and tag(s), which will trigger the `publish_release`
# and `publish_bumped_packages` workflows.
prepare_release:
parameters:
version:
type: string
latest:
type: boolean
default: false
dryrun:
# TODO(T182538198): Required for 0.74.x, where workspace packages are out
# of sync with react-native. This will be removed for 0.75+.
monorepo_packages_version:
type: string
tag:
type: string
dry_run:
type: boolean
default: false
executor: reactnativeios
executor: nodelts
steps:
- checkout_code_with_cache
- run_yarn
- add_ssh_keys:
fingerprints:
- "1f:c7:61:c4:e2:ff:77:e3:cc:ca:a7:34:c2:79:e3:3c"
- brew_install:
package: cmake
- run:
name: "Set new react-native version and commit changes"
name: Versioning workspace packages
command: |
VERSION=<< parameters.version >>
if [[ -z "$VERSION" ]]; then
VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | head -1)
echo "Using the version from the package.json: $VERSION"
fi
node ./scripts/releases-ci/prepare-package-for-release.js -v "$VERSION" -l << parameters.latest >> --dry-run << parameters.dryrun >>
node scripts/releases/set-version "<< parameters.monorepo_packages_version >>" --skip-react-native-version
- run:
name: Versioning react-native package
command: |
node scripts/releases/set-rn-version.js -v "<< parameters.version >>" --build-type "release"
- run:
name: Creating release commit
command: |
# I'm seeing failures in automatically detect the email for the
# agent that should push the commit.
git config --global user.name "Distiller"
git config --global user.email "[email protected]"
git commit -a -m "Release << parameters.version >>" -m "#publish-packages-to-npm&<< parameters.tag >>"
git tag -a "v<< parameters.version >>" -m "v<< parameters.version >>"
GIT_PAGER=cat git show HEAD
- when:
condition:
equal: ["latest", << parameters.tag >>]
steps:
- run:
name: Updating "latest" tag
command: |
git tag -d "latest"
git push origin :latest
git tag -a "latest" -m "latest"
- unless:
condition: << parameters.dry_run >>
steps:
run:
name: Pushing release commit
command: |
git push origin $CIRCLE_BRANCH --follow-tags
build_npm_package:
parameters:
Expand Down
Loading

0 comments on commit 4c16290

Please sign in to comment.