11name : in-app-payment-react-native-plugin
2+
23on : [push]
4+
35jobs :
46 install-and-test :
57 runs-on : ubuntu-latest
68 steps :
7- - uses : actions/checkout@v2
8- - uses : actions/setup-node@v2
9+ - uses : actions/checkout@v4
10+
11+ - uses : actions/setup-node@v4
912 with :
10- node-version : 18.x
11- - run : |
12- yarn && yarn lint && yarn test
13- cd example-expo && yarn && cd ..
13+ node-version : 20.x
14+ cache : ' yarn'
15+
16+ - name : Install deps & build lib
17+ run : |
18+ # Instala deps del plugin raíz
19+ yarn install
20+ # Genera lib/module + types (bob build)
21+ yarn prepare
22+
23+ - name : Lint & Test
24+ run : |
25+ yarn lint
26+ yarn test
27+
28+ - name : Install example-expo deps
29+ run : |
30+ cd example-expo
31+ yarn install
1432
1533 build-android :
1634 needs : install-and-test
1735 runs-on : ubuntu-latest
1836 steps :
1937 - name : Checkout repository
2038 uses : actions/checkout@v4
39+
40+ - name : Set up Node.js
41+ uses : actions/setup-node@v4
42+ with :
43+ node-version : 20.x
44+ cache : ' yarn'
45+
2146 - name : Set up JDK 17
2247 uses : actions/setup-java@v4
2348 with :
2449 distribution : ' temurin'
2550 java-version : ' 17'
51+
52+ # 🔧 liberar espacio para evitar "No space left on device"
53+ - name : Free disk space
54+ run : |
55+ echo "Disk BEFORE:"
56+ df -h
57+ sudo rm -rf /usr/share/dotnet
58+ sudo rm -rf /opt/ghc
59+ sudo rm -rf /opt/hostedtoolcache/CodeQL
60+ echo "Disk AFTER:"
61+ df -h
62+
2663 - name : Cache Gradle Wrapper
2764 uses : actions/cache@v4
2865 with :
2966 path : ~/.gradle/wrapper
30- key : ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
67+ key : ${{ runner.os }}-gradle-wrapper-${{ hashFiles('example-expo/android/gradle/wrapper/gradle-wrapper.properties') }}
68+
3169 - name : Cache Gradle Dependencies
3270 uses : actions/cache@v4
3371 with :
3472 path : ~/.gradle/caches
35- key : ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
73+ key : ${{ runner.os }}-gradle-caches-${{ hashFiles('example-expo/android/ gradle/wrapper/gradle-wrapper.properties') }}
3674 restore-keys : |
37- ${{ runner.os }}-gradle-caches-
38- - name : Install npm dependencies
39- uses : actions/checkout@v2
75+ ${{ runner.os }}-gradle-caches-
4076
4177 - name : Install deps & build plugin (lib/)
4278 run : |
4379 yarn install
4480 yarn prepare
4581 echo "Contenido de lib:"
4682 ls -R lib || echo "⚠️ lib no existe, bob build no se ejecutó bien"
83+
4784 - name : Build Android
4885 run : |
49- yarn
50- cd example-expo && yarn
86+ cd example-expo
87+ yarn install
5188 npx expo prebuild -p android
52- cd android && ./gradlew clean build
89+ cd android
90+ ./gradlew :app:assembleRelease
5391
5492 build-ios :
5593 needs : install-and-test
5694 runs-on : macos-latest
5795 steps :
58- - uses : actions/checkout@v2
96+ - uses : actions/checkout@v4
97+
5998 - name : Use Node.js
60- uses : actions/setup-node@v3
99+ uses : actions/setup-node@v4
61100 with :
62- node-version : 18.x
63- - run : |
64- gem install cocoapods
101+ node-version : 20.x
102+ cache : ' yarn'
103+
104+ - name : Install deps & build lib
105+ run : |
106+ yarn install
107+ yarn prepare
108+
109+ - name : Install CocoaPods
110+ run : gem install cocoapods
111+
112+ - name : Prebuild & install pods
113+ run : |
65114 cd example-expo
66- yarn
115+ yarn install
67116 npx expo prebuild -p ios
68- cd ios && pod install
117+ cd ios
118+ pod install
119+
69120 - name : Build iOS (debug)
70- run : " xcodebuild \
71- -workspace example-expo/ios/SquareInAppPaymentsExpoExample.xcworkspace \
72- -scheme SquareInAppPaymentsExpoExample \
73- clean archive \
74- -sdk iphoneos \
75- -configuration Debug \
76- -UseModernBuildSystem=NO \
77- -archivePath $PWD/SquareInAppPaymentsExpoExample \
78- CODE_SIGNING_ALLOWED=NO \
79- CODE_SIGNING_REQUIRED=NO \
80- CODE_SIGN_IDENTITY=NO"
121+ run : |
122+ xcodebuild \
123+ -workspace example-expo/ios/SquareInAppPaymentsExpoExample.xcworkspace \
124+ -scheme SquareInAppPaymentsExpoExample \
125+ clean archive \
126+ -sdk iphoneos \
127+ -configuration Debug \
128+ -UseModernBuildSystem=NO \
129+ -archivePath $PWD/SquareInAppPaymentsExpoExample \
130+ CODE_SIGNING_ALLOWED=NO \
131+ CODE_SIGNING_REQUIRED=NO \
132+ CODE_SIGN_IDENTITY=NO
0 commit comments