Refactor widget prefs 6177951123037805482 #203
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
| # GitHub Actions workflow to build an Android APK for The-Loop | |
| # Save this file as .github/workflows/android-build.yml in your repo | |
| # It will produce an unsigned debug APK and upload it as a workflow artifact. | |
| name: Build Android APK | |
| on: | |
| push: | |
| branches: [ feature/initial-app-build-with-personalization, main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: {} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| # optimized action for gradle caching and distribution | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| # This action instantly configures the path to the pre-installed SDK | |
| # It takes seconds, whereas downloading manually takes minutes. | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Android SDK Packages | |
| run: | | |
| yes | sdkmanager --licenses | |
| sdkmanager "platforms;android-34" "build-tools;34.0.0" | |
| - name: Build debug APK | |
| run: ./gradlew assembleDebug --no-daemon | |
| - name: Rename APK with version | |
| run: | | |
| # Extract version name from build.gradle | |
| VERSION_NAME=$(grep "versionName" app/build.gradle | head -n1 | awk '{print $2}' | tr -d '"') | |
| echo "Detected version: $VERSION_NAME" | |
| # Find the generated APK | |
| APK_PATH=$(find app/build/outputs/apk/debug -name "app-debug.apk" -print -quit) | |
| if [ -n "$APK_PATH" ]; then | |
| NEW_NAME="app/build/outputs/apk/debug/TheLoop-v${VERSION_NAME}-debug.apk" | |
| mv "$APK_PATH" "$NEW_NAME" | |
| echo "Renamed APK to: $NEW_NAME" | |
| else | |
| echo "APK not found!" | |
| exit 1 | |
| fi | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: the-loop-debug-apk | |
| path: app/build/outputs/apk/debug/TheLoop-*.apk |