chore: 🔄 synced file(s) with latest changes #1
Workflow file for this run
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: rn-sample-internal-ci | |
| on: | |
| pull_request: | |
| branches: [ "master" ] | |
| push: | |
| branches: [ "master" ] | |
| concurrency: | |
| group: PR-${{ github.repository }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: xlarge-dind | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| actions: read | |
| if: ${{ github.repository == 'crcl-main/w3s-rn-sample-app-wallets-internal' }} # Making sure it will run only on @crcl-main and not on forks | |
| steps: | |
| - name: Run Circle actions runner setup | |
| uses: crcl-main/circle-runner-setup-action@v5 | |
| with: | |
| repository: ${{ github.repository }} | |
| branch: ${{ github.ref }} | |
| ecr_registries: 124945441934 | |
| - name: Checkout pw-rn repository | |
| uses: actions/checkout@v4 | |
| - name: Setup node | |
| uses: actions/setup-node@v3 | |
| with: | |
| cache: 'npm' | |
| cache-dependency-path: 'package-lock.json' | |
| node-version: 20.x | |
| registry-url: https://npm.pkg.github.com/ | |
| - name: Read secrets from AWS Secrets Manager into environment variables | |
| uses: abhilash1in/aws-secrets-manager-action@v2.1.0 | |
| with: | |
| parse-json: false | |
| secrets: | | |
| /ops/utilities/github-actions-bot/ssh-priv-key | |
| /ops/utilities/github-actions-bot/package-read-token | |
| /ops/utilities/pw-sdk-android/maven/crcl-username | |
| /ops/utilities/pw-sdk-android/maven/crcl-password | |
| /ops/utilities/pw-sdk-android/staging/google-web-client-id | |
| /ops/utilities/pw-sdk-android/staging/facebook-app-id | |
| /ops/utilities/pw-sdk-android/staging/fb-login-protocal-scheme | |
| /ops/utilities/pw-sdk-android/staging/facebook-client-token | |
| /ops/utilities/pw-sdk-android/staging/apple-service-id | |
| /ops/utilities/pw-sdk-android/staging/circle-pw-sample-app-google-services-json | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: 17 | |
| distribution: "adopt" | |
| cache: "gradle" | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Create .env file for Android SDK credentials | |
| env: | |
| URL: https://maven.pkg.github.com/circlefin/w3s-android-sdk | |
| USERNAME: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_MAVEN_CRCL_USERNAME }} | |
| PASSWORD: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_MAVEN_CRCL_PASSWORD }} | |
| run: | | |
| touch .env | |
| echo "PWSDK_MAVEN_URL=${URL}" >> .env | |
| echo "PWSDK_MAVEN_USERNAME=${USERNAME}" >> .env | |
| echo "PWSDK_MAVEN_PASSWORD=${PASSWORD}" >> .env | |
| cat .env | |
| - name: Install dependencies and generate native code | |
| env: | |
| USERNAME: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_MAVEN_CRCL_USERNAME }} | |
| PASSWORD: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_MAVEN_CRCL_PASSWORD }} | |
| CLOUDSMITH_API_KEY: ${{ env.CLOUDSMITH_API_KEY }} | |
| BUILDNUMBER: ${{ github.run_number }} | |
| run: | | |
| echo @circlefin:registry=https://npm.cloudsmith.io/circle/common-private/ > .npmrc | |
| echo //npm.cloudsmith.io/circle/common-private/:_authToken=${CLOUDSMITH_API_KEY} >> .npmrc | |
| cat .npmrc | |
| sed -i 's/1.0.0/1.0.'"$BUILDNUMBER"'/g' package.json | |
| npm install | |
| npx expo prebuild --clean --no-install | |
| # Previous example-bare workflow (kept for reference): | |
| # sed -i 's/@circle-fin/@circlefin/g' package.json | |
| # sed -i 's/1.1.5/1.1.5-rc.24/g' package.json | |
| # sed -i 's/@circle-fin/@circlefin/g' src/utils/useWalletSdk.ts | |
| # sed -i 's/@circle-fin/@circlefin/g' src/components/SocialLoginButton.tsx | |
| # sed -i 's/@circle-fin/@circlefin/g' src/components/SocialTab.tsx | |
| # yarn install | |
| # yarn lint | |
| # yarn build:android | |
| - name: Configure Gradle memory settings | |
| run: | | |
| cd android | |
| sed -i 's/org.gradle.jvmargs=.*/org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError/g' gradle.properties | |
| echo "Gradle memory configuration:" | |
| grep "org.gradle.jvmargs" gradle.properties | |
| - name: Internal build | |
| timeout-minutes: 45 | |
| env: | |
| BUILDNUMBER: ${{ github.run_number }} | |
| PWSDK_MAVEN_URL: https://maven.pkg.github.com/circlefin/w3s-android-sdk | |
| PWSDK_MAVEN_USERNAME: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_MAVEN_CRCL_USERNAME }} | |
| PWSDK_MAVEN_PASSWORD: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_MAVEN_CRCL_PASSWORD }} | |
| GOOGLE_SERVICES_JSON: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_STAGING_CIRCLE_PW_SAMPLE_APP_GOOGLE_SERVICES_JSON }} | |
| GOOGLE_WEB_CLIENT_ID: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_STAGING_GOOGLE_WEB_CLIENT_ID }} | |
| FACEBOOK_APP_ID: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_STAGING_FACEBOOK_APP_ID }} | |
| FACEBOOK_CLIENT_TOKEN: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_STAGING_FACEBOOK_CLIENT_TOKEN }} | |
| APPLE_SERVICE_ID: ${{ env._OPS_UTILITIES_PW_SDK_ANDROID_STAGING_APPLE_SERVICE_ID }} | |
| run: | | |
| cd android | |
| touch local.properties | |
| echo "sdk.dir=$ANDROID_SDK_ROOT" >> local.properties | |
| cat local.properties | |
| touch app/google-services.json | |
| echo $GOOGLE_SERVICES_JSON > app/google-services.json | |
| sed -i 's/YOUR_GOOGLE_WEB_CLIENT_ID/$GOOGLE_WEB_CLIENT_ID/g' app/src/main/res/values/strings.xml | |
| sed -i 's/YOUR_FACEBOOK_APP_ID/$FACEBOOK_APP_ID/g' app/src/main/res/values/strings.xml | |
| sed -i 's/YOUR_FACEBOOK_CLIENT_TOKEN/$FACEBOOK_CLIENT_TOKEN/g' app/src/main/res/values/strings.xml | |
| sed -i 's/YOUR_APPLE_SERVICE_ID/$APPLE_SERVICE_ID/g' app/build.gradle | |
| echo "Starting Gradle build at $(date)" | |
| ./gradlew assembleRelease --no-daemon --stacktrace --info --max-workers=2 --console=plain | |
| echo "Gradle build completed at $(date)" | |
| ./gradlew signReport | |
| - name: Compress build artifacts | |
| if: ${{ always() }} | |
| run: | | |
| set -euo pipefail | |
| mkdir -p artifacts-temp | |
| echo "=== Collecting build artifacts ===" | |
| # Collect APK files | |
| if [ -d android/app/build/outputs/apk/release ]; then | |
| cp -r android/app/build/outputs/apk/release artifacts-temp/ | |
| echo "✓ Copied release APK" | |
| else | |
| echo "⚠️ Release APK directory not found!" | |
| fi | |
| # Check if we collected anything | |
| file_count=$(find artifacts-temp -type f | wc -l) | |
| echo "" | |
| echo "=== Collection summary ===" | |
| if [ "$file_count" -eq 0 ]; then | |
| echo "WARNING: No build artifacts collected - build may have failed" >&2 | |
| echo "Creating minimal artifact to preserve build status" >&2 | |
| echo "No artifacts produced at $(date)" > artifacts-temp/NO_ARTIFACTS.txt | |
| else | |
| echo "✓ Collected $file_count build artifact files" | |
| echo "File breakdown:" | |
| find artifacts-temp -type f | |
| fi | |
| # Create compressed archive | |
| tar -czf internalBuild.tar.gz --hard-dereference -C artifacts-temp . | |
| rm -rf artifacts-temp | |
| echo "" | |
| echo "✓ Created internalBuild.tar.gz ($(du -h internalBuild.tar.gz | cut -f1))" | |
| shell: bash | |
| - name: Upload | |
| uses: crcl-main/upload-artifacts-github-action@1 | |
| if: ${{ always() }} | |
| with: | |
| bucket: "circle-cicd-artifacts" | |
| name: internalBuild | |
| path: internalBuild.tar.gz |