diff --git a/.github/workflows/build-android-debug-aab.yml b/.github/workflows/build-android-debug-aab.yml new file mode 100644 index 0000000..4786c1d --- /dev/null +++ b/.github/workflows/build-android-debug-aab.yml @@ -0,0 +1,47 @@ +name: Build Android App Debug AAB + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '11' + + - name: Install NPM Packages + working-directory: app + run: npm i + + - name: Decode and save the keystore file + working-directory: app/android/app + run: | + echo "${{ secrets.ANDROID_UPLOAD_KEYSTORE_FILE_BASE64 }}" | base64 --decode > my-upload-key.keystore + + - name: Build Android App AAB + working-directory: app/android + run: ./gradlew bundleDebug + env: + KEYSTORE_FILE: my-upload-key.keystore + KEYSTORE_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_ALIAS }} + KEY_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_KEY_PASSWORD }} + + - name: Upload AAB + uses: actions/upload-artifact@v4 + with: + name: app-debug.aab + path: app/android/app/build/outputs/bundle/release/app-release.aab diff --git a/.github/workflows/build-android-debug-apk.yml b/.github/workflows/build-android-debug-apk.yml new file mode 100644 index 0000000..9b61052 --- /dev/null +++ b/.github/workflows/build-android-debug-apk.yml @@ -0,0 +1,47 @@ +name: Build Android App Debug APK + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '11' + + - name: Install NPM Packages + working-directory: app + run: npm i + + - name: Decode and save the keystore file + working-directory: app/android/app + run: | + echo "${{ secrets.ANDROID_UPLOAD_KEYSTORE_FILE_BASE64 }}" | base64 --decode > my-upload-key.keystore + + - name: Build Android App APK + working-directory: app/android + run: ./gradlew assembleDebug + env: + KEYSTORE_FILE: my-upload-key.keystore + KEYSTORE_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_ALIAS }} + KEY_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_KEY_PASSWORD }} + + - name: Upload APK + uses: actions/upload-artifact@v4 + with: + name: app-debug.apk + path: app/android/app/build/outputs/bundle/release/app-release.aab diff --git a/.github/workflows/build-android-release-aab.yml b/.github/workflows/build-android-release-aab.yml new file mode 100644 index 0000000..bbae22a --- /dev/null +++ b/.github/workflows/build-android-release-aab.yml @@ -0,0 +1,47 @@ +name: Build Android App Release AAB + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '11' + + - name: Install NPM Packages + working-directory: app + run: npm i + + - name: Decode and save the keystore file + working-directory: app/android/app + run: | + echo "${{ secrets.ANDROID_UPLOAD_KEYSTORE_FILE_BASE64 }}" | base64 --decode > my-upload-key.keystore + + - name: Build Android App AAB + working-directory: app/android + run: ./gradlew bundleRelease + env: + KEYSTORE_FILE: my-upload-key.keystore + KEYSTORE_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_ALIAS }} + KEY_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_KEY_PASSWORD }} + + - name: Upload AAB + uses: actions/upload-artifact@v4 + with: + name: app-release.aab + path: app/android/app/build/outputs/bundle/release/app-release.aab diff --git a/.github/workflows/build-android-release-apk.yml b/.github/workflows/build-android-release-apk.yml new file mode 100644 index 0000000..e7c5211 --- /dev/null +++ b/.github/workflows/build-android-release-apk.yml @@ -0,0 +1,47 @@ +name: Build Android App Release APK + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '11' + + - name: Install NPM Packages + working-directory: app + run: npm i + + - name: Decode and save the keystore file + working-directory: app/android/app + run: | + echo "${{ secrets.ANDROID_UPLOAD_KEYSTORE_FILE_BASE64 }}" | base64 --decode > my-upload-key.keystore + + - name: Build Android App APK + working-directory: app/android + run: ./gradlew assembleRelease + env: + KEYSTORE_FILE: my-upload-key.keystore + KEYSTORE_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_ALIAS }} + KEY_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_KEY_PASSWORD }} + + - name: Upload APK + uses: actions/upload-artifact@v4 + with: + name: app-release.apk + path: app/android/app/build/outputs/apk/release/app-release.apk diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index 1091c49..fa196b0 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -88,6 +88,12 @@ android { keyAlias 'androiddebugkey' keyPassword 'android' } + release { + storeFile file(System.getenv('KEYSTORE_FILE')) + storePassword System.getenv('KEYSTORE_PASSWORD') + keyAlias System.getenv('KEY_ALIAS') + keyPassword System.getenv('KEY_PASSWORD') + } } buildTypes { debug { @@ -96,7 +102,7 @@ android { release { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } @@ -107,12 +113,12 @@ dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") - //debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") - //debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { - // exclude group:'com.squareup.okhttp3', module:'okhttp' - //} + debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") + debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { + exclude group:'com.squareup.okhttp3', module:'okhttp' + } - //debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") + debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") } else {