Skip to content

Commit

Permalink
replace yarn by npm from worflows
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-chaix-didomi committed Aug 2, 2024
1 parent 374e032 commit bd88d45
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 79 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,30 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4

- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- run: yarn prepare
- run: npm publish --access public

- name: Install dependencies
run: npm install

- name: Prepare and publish
run: |
npm run prepare
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ jobs:
with:
node-version: 20

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install

run: npm install
- name: Run JS tests
run: yarn test
run: npm test

test_android:
name: Testing Android
Expand All @@ -54,7 +54,7 @@ jobs:
with:
node-version: 20

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
Expand All @@ -63,7 +63,7 @@ jobs:
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install
run: npm install

- name: Cache Gradle Wrapper
uses: actions/cache@v4
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
Expand All @@ -149,7 +149,7 @@ jobs:
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install
run: npm install

- name: Install pods
run: cd ios && pod install
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
node-version: 20

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
Expand All @@ -33,10 +33,10 @@ jobs:
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install
run: npm install

- name: Run JS tests
run: yarn test
run: npm test

android:
needs: js
Expand All @@ -54,16 +54,19 @@ jobs:
with:
node-version: 20

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install bob
run: npm install -g react-native-builder-bob

- name: Install dependencies
run: yarn install
run: npm install

- name: Cache Gradle Wrapper
uses: actions/cache@v4
Expand Down Expand Up @@ -140,16 +143,19 @@ jobs:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install bob
run: npm install -g react-native-builder-bob

- name: Install dependencies
run: yarn install
run: npm install

- name: Install pods
run: cd ios && pod install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ jobs:
with:
node-version: 20

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install
run: npm install

- name: Update React Native SDK
run: |
Expand Down
67 changes: 38 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
Expand All @@ -27,44 +20,60 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Xcode / tests
#
testApp/ios/main.jsbundle
**/.xcode.env.local

# Android/IJ
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# Ruby / CocoaPods
#
testApp/ios/Pods
testApp/vendor/bundle/
sampleApp/ios/Pods
sampleApp/vendor/bundle/
.cxx/
*.keystore
!debug.keystore

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
**/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# testing
/coverage

# Expo
.expo/*
# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# generated by bob
# generated by sample / test
lib/
package-lock.json
Podfile.lock
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-prettier": "^3.1.3",
"husky": "^4.2.5",
"jest": "^26.6.3",
"jest": "^29.7.0",
"metro-config": "^0.80.9",
"pod-install": "^0.1.0",
"prettier": "^2.0.5",
"react": "17.0.2",
"react-native": "0.68.5",
"react-native-builder-bob": "^0.18.0",
"react-native-builder-bob": "^0.18.3",
"react-native-monorepo-tools": "^1.2.1",
"release-it": "^14.2.2",
"typescript": "^4.1.3"
Expand Down
17 changes: 0 additions & 17 deletions sample/__tests__/App.test.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion testApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.0.0",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.0.0",
"metro-react-native-babel-preset": "^0.67.0",
"react-test-renderer": "17.0.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[ -f yarn.lock ] && rm yarn.lock && echo "yarn.lock deleted"
)

yarn install
yarnpmn install

# Makes gradlew executable
chmod +x ./android/gradlew
Expand Down
5 changes: 2 additions & 3 deletions testApp/scripts/ios/prepare-ui-tests-locally-ios.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Delete `package-lock.json` and `yarn.lock`
(
[ -f package-lock.json ] && rm package-lock.json && echo "package-lock.json deleted"
# Comment this line locally because of failure with Xcode 15 (Yoga.cpp needs to be updated to work with Xcode 15)
# [ -f yarn.lock ] && rm yarn.lock && echo "yarn.lock deleted"
[ -f yarn.lock ] && rm yarn.lock && echo "yarn.lock deleted"
)

yarn install
npm install

# Update pods
pod update --project-directory=./ios && pod install --project-directory=./ios
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{
"extends": "./tsconfig",
"exclude": ["testApp", "sampleApp"]
"exclude": ["testApp", "sample"]
}

0 comments on commit bd88d45

Please sign in to comment.