Set default net to signet #56
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: BuildReleaseApk | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| types: [opened, synchronize, reopened, labeled, unlabeled] | ||
| push: | ||
| branches: | ||
| - master | ||
| jobs: | ||
| buildReleaseApk: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Checkout project | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| fetch-depth: "0" | ||
| - name: Free disk space (Android build) | ||
| shell: bash | ||
| run: | | ||
| df -h | ||
| sudo rm -rf /usr/share/dotnet || true | ||
| sudo rm -rf /opt/ghc || true | ||
| sudo rm -rf /usr/local/share/boost || true | ||
| sudo rm -rf /usr/local/lib/android/sdk/ndk || true | ||
| docker system prune -af || true | ||
| sudo rm -rf /usr/local/lib/android/sdk/system-images || true | ||
| sudo rm -rf /usr/local/lib/android/sdk/emulator || true | ||
| rm -rf ~/.gradle/caches/modules-2/files-2.1 || true | ||
| rm -rf ~/.gradle/caches/build-cache || true | ||
| rm -rf ~/.npm/_cacache ~/.cache || true | ||
| sudo rm -rf /home/runner/work/_temp || true | ||
| df -h | ||
| - name: Specify node version | ||
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | ||
| with: | ||
| node-version: 24 | ||
| cache: 'npm' | ||
| cache-dependency-path: package-lock.json | ||
| - name: Use specific Java version for sdkmanager to work | ||
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '17' | ||
| cache: 'gradle' | ||
| - name: Set up Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
| - name: Install Android SDK components | ||
| run: | | ||
| yes | sdkmanager --licenses | ||
| sdkmanager "platforms;android-36" "platform-tools" "build-tools;36.0.0" "ndk;27.1.12297006" | ||
| - name: Set default network | ||
| run: ./scripts/set-network.sh signet | ||
| - name: Install node_modules (include dev deps for patch-package) | ||
| run: npm ci --yes | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 3.4.8 | ||
| bundler-cache: true | ||
| - name: Cache Ruby Gems | ||
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5 | ||
| with: | ||
| path: vendor/bundle | ||
| key: ${{ runner.os }}-ruby-${{ hashFiles('**/Gemfile.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-ruby- | ||
| - name: Generate Build Number based on timestamp | ||
| id: build_number | ||
| run: | | ||
| NEW_BUILD_NUMBER="$(date +%s)" | ||
| echo "NEW_BUILD_NUMBER=$NEW_BUILD_NUMBER" >> $GITHUB_ENV | ||
| echo "build_number=$NEW_BUILD_NUMBER" >> $GITHUB_OUTPUT | ||
| <<<<<<< HEAD | ||
| - name: Build and sign APK | ||
| id: build_and_sign_apk | ||
| run: bundle exec fastlane android build_release_apk | ||
| ======= | ||
| - name: Build release AAB | ||
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/2025-12-03-redwallet' | ||
| id: build_release_aab | ||
| run: bundle exec fastlane android build_release_aab | ||
| >>>>>>> 81bdf7f92 (ci: automatically upload android builds to Play Store internal testing) | ||
| env: | ||
| BUILD_NUMBER: ${{ steps.build_number.outputs.build_number }} | ||
| KEYSTORE_FILE_HEX: ${{ secrets.KEYSTORE_FILE_HEX }} | ||
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||
| - name: Upload build logs on failure | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: android-build-logs | ||
| path: | | ||
| fastlane/logs/**/*.log | ||
| android/**/*.log | ||
| android/**/build/**/*.log | ||
| android/**/outputs/logs/**/*.log | ||
| android/**/reports/**/*.log | ||
| if-no-files-found: warn | ||
| - name: Build Debug APK (non-master branches) | ||
| if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/2025-12-03-redwallet' | ||
| run: | | ||
| cd android && ./gradlew assembleDebug --no-daemon | ||
| - name: Determine AAB Filename and Path | ||
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/2025-12-03-redwallet' | ||
| id: determine_aab_path | ||
| run: | | ||
| BUILD_NUMBER=${{ steps.build_number.outputs.build_number }} | ||
| VERSION_NAME=$(grep versionName android/app/build.gradle | awk '{print $2}' | tr -d '"') | ||
| BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}} | ||
| BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9_-]/_/g') | ||
| if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then | ||
| EXPECTED_FILENAME="BlueWallet-${VERSION_NAME}-${BUILD_NUMBER}-${BRANCH_NAME}.aab" | ||
| else | ||
| EXPECTED_FILENAME="BlueWallet-${VERSION_NAME}-${BUILD_NUMBER}.aab" | ||
| fi | ||
| AAB_PATH="android/app/build/outputs/bundle/release/${EXPECTED_FILENAME}" | ||
| echo "AAB_PATH=${AAB_PATH}" >> $GITHUB_ENV | ||
| - name: Upload signed AAB as artifact | ||
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/2025-12-03-redwallet' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: signed-aab | ||
| path: ${{ env.AAB_PATH }} | ||
| if-no-files-found: error | ||
| browserstack: | ||
| runs-on: macos-latest | ||
| needs: buildReleaseApk | ||
| if: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'browserstack') }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 3.4.8 | ||
| bundler-cache: true | ||
| - name: Install dependencies with Bundler | ||
| run: bundle install --jobs 4 --retry 3 | ||
| - name: Download AAB artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: signed-aab | ||
| - name: Set APK Path | ||
| run: | | ||
| APK_PATH=$(find ${{ github.workspace }} -name '*.aab') | ||
| echo "APK_PATH=$APK_PATH" >> $GITHUB_ENV | ||
| - name: Upload AAB to BrowserStack and Post PR Comment | ||
| env: | ||
| BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | ||
| BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | ||
| GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: bundle exec fastlane upload_to_browserstack_and_comment | ||
| play-store-upload: | ||
| runs-on: ubuntu-latest | ||
| needs: buildReleaseApk | ||
| if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/2025-12-03-redwallet') | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 3.1.6 | ||
| bundler-cache: true | ||
| - name: Install dependencies with Bundler | ||
| run: bundle install --jobs 4 --retry 3 | ||
| - name: Download AAB artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: signed-aab | ||
| - name: Set AAB Path | ||
| run: | | ||
| AAB_PATH=$(find ${{ github.workspace }} -name '*.aab') | ||
| echo "AAB_PATH=$AAB_PATH" >> $GITHUB_ENV | ||
| - name: Upload to Google Play Internal Testing | ||
| env: | ||
| GOOGLE_PLAY_JSON_KEY: ${{ secrets.GOOGLE_PLAY_JSON_KEY }} | ||
| AAB_PATH: ${{ env.AAB_PATH }} | ||
| run: bundle exec fastlane android deploy_to_play_store | ||