Android Debug APK (manual) #20
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: Android Debug APK (manual) | |
| on: | |
| workflow_dispatch: {} | |
| jobs: | |
| build-android-debug: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Use Node 22.15.0 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.15.0' | |
| - name: Install root dependencies | |
| run: npm ci | |
| - name: Build shared packages | |
| run: npm run build | |
| - name: Install app dependencies | |
| working-directory: ./apps/react-wallet | |
| run: npm ci | |
| - name: Set up Java 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v3 | |
| with: | |
| api-level: 35 | |
| build-tools: '35.0.0' | |
| - name: Build & Sync Capacitor | |
| working-directory: ./apps/react-wallet | |
| run: | | |
| npm run build | |
| npx cap sync android | |
| - name: Decode Keystore | |
| working-directory: ./apps/react-wallet | |
| run: | | |
| echo "${{ secrets.KEYSTORE_FILE_DEBUG }}" | base64 --decode > android/app/debug.keystore | |
| - name: Create key.properties | |
| working-directory: ./apps/react-wallet | |
| run: | | |
| cat > android/key.properties << EOF | |
| storePassword=debugandroid | |
| keyPassword=debugandroid | |
| keyAlias=debug | |
| storeFile=debug.keystore | |
| EOF | |
| - name: Set version code and name | |
| working-directory: ./apps/react-wallet | |
| env: | |
| VERSION_NAME: "1.0.${{ github.run_number }}" | |
| VERSION_CODE: ${{ github.run_number }} | |
| run: | | |
| sed -i "s/versionCode [0-9]*/versionCode $VERSION_CODE/" android/app/build.gradle | |
| sed -i "s/versionName \"[^\"]*\"/versionName \"$VERSION_NAME\"/" android/app/build.gradle | |
| echo "Building version $VERSION_NAME (code: $VERSION_CODE)" | |
| - name: Build Android debug APK | |
| working-directory: ./apps/react-wallet | |
| env: | |
| CI: true | |
| run: npm run android:build | |
| - name: Rename APK with version | |
| run: | | |
| mv apps/react-wallet/android/app/build/outputs/apk/debug/app-debug.apk \ | |
| apps/react-wallet/android/app/build/outputs/apk/debug/app-debug-1.0.${{ github.run_number }}.apk | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-debug-${{ github.run_number }} | |
| path: apps/react-wallet/android/app/build/outputs/apk/debug/app-debug-1.0.${{ github.run_number }}.apk | |
| if-no-files-found: error |