Firefox Android #1
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: Firefox Android | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| build_type: | |
| description: Build type | |
| required: true | |
| type: choice | |
| default: debug | |
| options: | |
| - debug | |
| - release | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout Firefox | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| df -h | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| git \ | |
| curl \ | |
| wget \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| unzip \ | |
| zip \ | |
| build-essential \ | |
| clang \ | |
| lld \ | |
| ninja-build \ | |
| pkg-config \ | |
| autoconf2.13 \ | |
| ccache \ | |
| yasm \ | |
| nasm \ | |
| rustc \ | |
| cargo | |
| - name: Bootstrap Firefox Android | |
| run: | | |
| ./mach --no-interactive bootstrap \ | |
| --application-choice="GeckoView/Firefox for Android" | |
| - name: Configure ARM64 Android | |
| run: | | |
| cat > mozconfig <<'EOF' | |
| # Firefox for Android | |
| ac_add_options --enable-project=mobile/android | |
| ac_add_options --target=aarch64 | |
| ac_add_options --enable-artifact-builds | |
| mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-android | |
| ac_add_options --enable-release | |
| ac_add_options --with-android-min-sdk=24 | |
| EOF | |
| - name: Configure debug | |
| if: inputs.build_type == 'debug' | |
| run: | | |
| cat >> mozconfig <<'EOF' | |
| ac_add_options --enable-debug | |
| ac_add_options --disable-optimize | |
| EOF | |
| - name: Configure release | |
| if: inputs.build_type == 'release' | |
| run: | | |
| cat >> mozconfig <<'EOF' | |
| ac_add_options --enable-optimize | |
| ac_add_options --disable-debug | |
| EOF | |
| - name: Show configuration | |
| run: | | |
| echo "===== mozconfig =====" | |
| cat mozconfig | |
| echo "===== mach environment =====" | |
| ./mach environment | |
| - name: Build GeckoView | |
| run: | | |
| ./mach build | |
| - name: Build Fenix | |
| run: | | |
| ./mach gradle fenix:assembleDebug | |
| - name: Find APKs | |
| run: | | |
| echo "Generated APK files:" | |
| find objdir-android \ | |
| -type f \ | |
| -name "*.apk" \ | |
| - name: Collect APKs | |
| run: | | |
| mkdir -p artifacts | |
| find objdir-android \ | |
| -type f \ | |
| -name "*.apk" \ | |
| -exec cp {} artifacts/ \; | |
| ls -lh artifacts | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: firefox-android-${{ inputs.build_type }} | |
| path: artifacts/*.apk | |
| if-no-files-found: error | |
| retention-days: 30 |