From 12550d34e620b8bee74905db5d46906288570dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Gu=CC=88ner?= Date: Fri, 29 Sep 2023 18:46:49 +0300 Subject: [PATCH 1/3] feat: use yarn with rncli depending on env --- .../src/utils/generateExampleApp.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/create-react-native-library/src/utils/generateExampleApp.ts b/packages/create-react-native-library/src/utils/generateExampleApp.ts index de52dcb3e..0b372a524 100644 --- a/packages/create-react-native-library/src/utils/generateExampleApp.ts +++ b/packages/create-react-native-library/src/utils/generateExampleApp.ts @@ -79,11 +79,19 @@ export default async function generateExampleApp({ '--version', reactNativeVersion, '--skip-install', - '--npm', ] : // `npx create-expo-app example --no-install` ['create-expo-app@latest', directory, '--no-install']; + if (type === 'native') { + if (!process.env.USE_YARN) { + console.debug('Using React Native CLI with npm to create example app'); + args.push('--npm'); + } else { + console.debug('Using React Native CLI with Yarn to create example app'); + } + } + await spawn('npx', args, { cwd: dest, env: { ...process.env, npm_config_yes: 'true' }, From f217585f5ba020b2c1d2ff6c2e69f2d9ffaf45f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Gu=CC=88ner?= Date: Fri, 29 Sep 2023 18:51:47 +0300 Subject: [PATCH 2/3] chore: use yarn with rncli on CI --- .github/workflows/build-templates.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-templates.yml b/.github/workflows/build-templates.yml index c5a1de290..fdea4b1a6 100644 --- a/.github/workflows/build-templates.yml +++ b/.github/workflows/build-templates.yml @@ -102,6 +102,8 @@ jobs: echo "work_dir=${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}" >> $GITHUB_ENV - name: Create library + env: + USE_YARN: 1 run: | rm -rf ${{ env.work_dir }} # Workaround for tests failing intermittently ./packages/create-react-native-library/bin/create-react-native-library ${{ env.work_dir }} \ From 711665218e602af9b217fac9710fe8cdb19b62a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Gu=CC=88ner?= Date: Fri, 29 Sep 2023 19:51:48 +0300 Subject: [PATCH 3/3] chore: use ubuntu 20.04 on CI --- .github/workflows/build-templates.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-templates.yml b/.github/workflows/build-templates.yml index fdea4b1a6..a92e5b016 100644 --- a/.github/workflows/build-templates.yml +++ b/.github/workflows/build-templates.yml @@ -22,8 +22,8 @@ jobs: fail-fast: false matrix: os: - - ubuntu - - macos + - ubuntu-20.04 + - macos-12 type: - module-legacy - module-mixed @@ -37,9 +37,9 @@ jobs: - kotlin-objc - kotlin-swift exclude: - - os: macos + - os: macos-12 language: kotlin-objc - - os: macos + - os: macos-12 language: kotlin-swift - type: module-new language: java-swift @@ -58,25 +58,25 @@ jobs: - type: view-mixed language: kotlin-swift include: - - os: ubuntu + - os: ubuntu-20.04 type: library language: js - - os: ubuntu + - os: ubuntu-20.04 type: module-legacy language: cpp - - os: ubuntu + - os: ubuntu-20.04 type: module-mixed language: cpp - - os: ubuntu + - os: ubuntu-20.04 type: module-new language: cpp - - os: macos + - os: macos-12 type: module-legacy language: cpp - - os: macos + - os: macos-12 type: module-mixed language: cpp - - os: macos + - os: macos-12 type: module-new language: cpp @@ -84,7 +84,7 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }} cancel-in-progress: true - runs-on: ${{ matrix.os }}-latest + runs-on: ${{ matrix.os }} steps: - name: Checkout