|
| 1 | +# name: Setup React Native dependencies |
| 2 | +# description: Setup Node.js and install dependencies |
| 3 | + |
| 4 | +# runs: |
| 5 | +# using: composite |
| 6 | +# steps: |
| 7 | +# - name: Setup Node.js |
| 8 | +# uses: actions/setup-node@v4 |
| 9 | +# with: |
| 10 | +# node-version-file: ./packages/sdk-platforms/react-native/react-native-zksync-sso/.nvmrc |
| 11 | + |
| 12 | +# - name: Check React Native package exists |
| 13 | +# shell: bash |
| 14 | +# run: | |
| 15 | +# if [ ! -d "./packages/sdk-platforms/react-native/react-native-zksync-sso" ]; then |
| 16 | +# echo "Error: React Native package directory not found at ./packages/sdk-platforms/react-native/react-native-zksync-sso" |
| 17 | +# ls -la ./packages/sdk-platforms/react-native/react-native-zksync-sso || echo "react-native-zksync-sso directory not found" |
| 18 | +# ls -la ./packages/sdk-platforms/react-native || echo "react-native directory not found" |
| 19 | +# ls -la ./packages/sdk-platforms || echo "sdk-platforms directory not found" |
| 20 | +# ls -la ./packages || echo "packages directory not found" |
| 21 | +# exit 1 |
| 22 | +# fi |
| 23 | +# echo "React Native package directory found" |
| 24 | +# ls -la ./packages/sdk-platforms/react-native/react-native-zksync-sso |
| 25 | + |
| 26 | +# - name: Setup Yarn |
| 27 | +# shell: bash |
| 28 | +# run: | |
| 29 | +# echo "Setting up Yarn 3.6.1" |
| 30 | + |
| 31 | +# # Install yarn globally first |
| 32 | +# corepack enable |
| 33 | +# corepack prepare yarn@3.6.1 --activate |
| 34 | + |
| 35 | +# # Setup directories |
| 36 | +# mkdir -p ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/releases |
| 37 | +# mkdir -p ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/plugins/@yarnpkg |
| 38 | +# mkdir -p ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/cache |
| 39 | + |
| 40 | +# # Try to copy the yarn binary from corepack |
| 41 | +# if [ -f ~/.cache/node/corepack/v1/yarn/3.6.1/yarn.js ]; then |
| 42 | +# echo "Found yarn.js in corepack cache, copying..." |
| 43 | +# cp ~/.cache/node/corepack/v1/yarn/3.6.1/yarn.js ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/releases/yarn-3.6.1.cjs |
| 44 | +# else |
| 45 | +# echo "Corepack yarn.js not found, downloading yarn directly..." |
| 46 | +# # Download the yarn binary directly from GitHub |
| 47 | +# curl -L -o ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/releases/yarn-3.6.1.cjs https://github.com/yarnpkg/berry/releases/download/3.6.1/yarn-3.6.1.cjs |
| 48 | +# fi |
| 49 | + |
| 50 | +# # Verify the file exists and has content |
| 51 | +# if [ -f ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/releases/yarn-3.6.1.cjs ]; then |
| 52 | +# echo "Yarn binary installed successfully" |
| 53 | +# ls -la ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/releases |
| 54 | +# else |
| 55 | +# echo "Failed to install Yarn binary" |
| 56 | +# exit 1 |
| 57 | +# fi |
| 58 | + |
| 59 | +# # Create plugin files |
| 60 | +# echo "Creating plugin files" |
| 61 | +# touch ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs |
| 62 | +# touch ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs |
| 63 | + |
| 64 | +# # Verify plugins |
| 65 | +# ls -la ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/plugins/@yarnpkg |
| 66 | + |
| 67 | +# # Fallback: Also update .yarnrc.yml to use global yarn if needed |
| 68 | +# echo "Making a backup of original .yarnrc.yml" |
| 69 | +# cp ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml.bak |
| 70 | + |
| 71 | +# # Create a simpler .yarnrc.yml without the yarnPath |
| 72 | +# echo 'nodeLinker: node-modules' > ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml |
| 73 | +# echo 'nmHoistingLimits: workspaces' >> ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml |
| 74 | +# echo >> ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml |
| 75 | +# echo 'plugins:' >> ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml |
| 76 | +# echo ' - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs' >> ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml |
| 77 | +# echo ' spec: "@yarnpkg/plugin-interactive-tools"' >> ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml |
| 78 | +# echo ' - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs' >> ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml |
| 79 | +# echo ' spec: "@yarnpkg/plugin-workspace-tools"' >> ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml |
| 80 | + |
| 81 | +# echo "Modified .yarnrc.yml:" |
| 82 | +# cat ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarnrc.yml |
| 83 | + |
| 84 | +# - name: Restore dependencies |
| 85 | +# id: yarn-cache |
| 86 | +# uses: actions/cache/restore@v4 |
| 87 | +# with: |
| 88 | +# path: | |
| 89 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/node_modules |
| 90 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/example/node_modules |
| 91 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/install-state.gz |
| 92 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/releases |
| 93 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/plugins |
| 94 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/cache |
| 95 | +# key: ${{ runner.os }}-yarn-rn-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/yarn.lock') }}-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/package.json', './packages/sdk-platforms/react-native/react-native-zksync-sso/example/package.json') }} |
| 96 | +# restore-keys: | |
| 97 | +# ${{ runner.os }}-yarn-rn-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/yarn.lock') }} |
| 98 | +# ${{ runner.os }}-yarn-rn- |
| 99 | + |
| 100 | +# - name: Install dependencies |
| 101 | +# if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 102 | +# shell: bash |
| 103 | +# working-directory: ./packages/sdk-platforms/react-native/react-native-zksync-sso |
| 104 | +# run: | |
| 105 | +# echo "Installing dependencies" |
| 106 | +# yarn install --immutable || yarn install --immutable --no-immutable || npm install -g yarn && yarn install |
| 107 | + |
| 108 | +# - name: Verify dependencies |
| 109 | +# if: steps.yarn-cache.outputs.cache-hit == 'true' |
| 110 | +# shell: bash |
| 111 | +# working-directory: ./packages/sdk-platforms/react-native/react-native-zksync-sso |
| 112 | +# run: | |
| 113 | +# echo "Verifying dependencies" |
| 114 | +# yarn install --immutable --check-cache || yarn install --immutable || yarn install |
| 115 | + |
| 116 | +# - name: Cache dependencies |
| 117 | +# if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 118 | +# uses: actions/cache/save@v4 |
| 119 | +# with: |
| 120 | +# path: | |
| 121 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/node_modules |
| 122 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/example/node_modules |
| 123 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/install-state.gz |
| 124 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/releases |
| 125 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/plugins |
| 126 | +# ./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/cache |
| 127 | +# key: ${{ steps.yarn-cache.outputs.cache-primary-key }} |
0 commit comments