From 78c60aa6a5bf98dfb584d61bdf02b1afa609a35e Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Tue, 14 May 2024 06:36:51 -0500 Subject: [PATCH 1/4] build(ci): skip git init on test patch generation otherwise it causes an error and breaks patch generation --- .github/workflows/create_test_patches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_test_patches.yml b/.github/workflows/create_test_patches.yml index 498466d638..9dd9699143 100644 --- a/.github/workflows/create_test_patches.yml +++ b/.github/workflows/create_test_patches.yml @@ -71,7 +71,7 @@ jobs: done ls -la $HOME/packages/ cd $HOME - npx react-native init template --skip-install + npx react-native init template --skip-install --skip-git-init cd template yarn yarn add patch-package --save-dev From a4246ff06983ff72fca241a7f91d19b30f4a115c Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Tue, 14 May 2024 15:39:25 -0500 Subject: [PATCH 2/4] fix(ci): allow yarn lockfile modification in CI for patch generation --- .github/workflows/create_test_patches.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/create_test_patches.yml b/.github/workflows/create_test_patches.yml index 9dd9699143..7c3ed15830 100644 --- a/.github/workflows/create_test_patches.yml +++ b/.github/workflows/create_test_patches.yml @@ -58,6 +58,9 @@ jobs: command: DETOX_DISABLE_POSTINSTALL=1 yarn && yarn lerna:prepare - name: Create Patches + env: + # yarn3+ by default disables lockfile alteration in CI. We want it. + YARN_ENABLE_IMMUTABLE_INSTALLS: false run: | PACKAGE_LIST=`find packages -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | egrep -v 'template|invites'` mkdir $HOME/packages From 2362564025c177702f10aa48c1d5f5fc155231aa Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Tue, 14 May 2024 15:39:44 -0500 Subject: [PATCH 3/4] fix(ci): fix executable bits on ios_config script during patchset generation --- .github/workflows/create_test_patches.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/create_test_patches.yml b/.github/workflows/create_test_patches.yml index 7c3ed15830..be506d868b 100644 --- a/.github/workflows/create_test_patches.yml +++ b/.github/workflows/create_test_patches.yml @@ -85,6 +85,8 @@ jobs: if [ -d node_modules/@react-native-firebase/$PACKAGE ]; then pushd node_modules/@react-native-firebase tar -zxf $HOME/packages/react-native-firebase-${PACKAGE}.tgz + # yarn3+ pack does not handle the executable bits on our scripts correctly. Fix. + chmod 755 package/ios_config.sh && true mv $PACKAGE/package.json package/ \rm -fr $PACKAGE mv package $PACKAGE From 632e8b106652229f2da07ff0bf4d549cb7306d39 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Tue, 14 May 2024 15:54:49 -0500 Subject: [PATCH 4/4] fix(ci): use modern yarn syntax to add packages during patchset generation --- .github/workflows/create_test_patches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_test_patches.yml b/.github/workflows/create_test_patches.yml index be506d868b..aa647900f0 100644 --- a/.github/workflows/create_test_patches.yml +++ b/.github/workflows/create_test_patches.yml @@ -77,7 +77,7 @@ jobs: npx react-native init template --skip-install --skip-git-init cd template yarn - yarn add patch-package --save-dev + yarn add patch-package --dev mkdir patches || true for PACKAGE in $PACKAGE_LIST; do echo "Installing package $PACKAGE into fresh template app, then clobbering with PR version"