update publish pipeline #323
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: in-app-payment-react-native-plugin | |
| on: [push] | |
| jobs: | |
| install-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v2 | |
| with: | |
| node-version: 18.x | |
| - run: | | |
| yarn && yarn lint && yarn test | |
| cd example-expo && yarn && cd .. | |
| build-android: | |
| needs: install-and-test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| # 🔧 liberar espacio para evitar "No space left on device" | |
| - name: Free disk space | |
| run: | | |
| echo "Disk BEFORE:" | |
| df -h | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| echo "Disk AFTER:" | |
| df -h | |
| - name: Cache Gradle Wrapper | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
| - name: Cache Gradle Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle-caches- | |
| - name: Install npm dependencies | |
| uses: actions/checkout@v2 | |
| - name: Install deps & build plugin (lib/) | |
| run: | | |
| yarn install | |
| yarn prepare | |
| echo "Contenido de lib:" | |
| ls -R lib || echo "⚠️ lib no existe, bob build no se ejecutó bien" | |
| - name: Build Android | |
| run: | | |
| yarn | |
| cd example-expo && yarn | |
| npx expo prebuild -p android | |
| cd android | |
| ./gradlew :app:assembleRelease | |
| build-ios: | |
| needs: install-and-test | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18.x | |
| - run: | | |
| gem install cocoapods | |
| cd example-expo | |
| yarn | |
| npx expo prebuild -p ios | |
| cd ios && pod install | |
| - name: Build iOS (debug) | |
| run: "xcodebuild \ | |
| -workspace example-expo/ios/SquareInAppPaymentsExpoExample.xcworkspace \ | |
| -scheme SquareInAppPaymentsExpoExample \ | |
| clean archive \ | |
| -sdk iphoneos \ | |
| -configuration Debug \ | |
| -UseModernBuildSystem=NO \ | |
| -archivePath $PWD/SquareInAppPaymentsExpoExample \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGN_IDENTITY=NO" |