Repository navigation
Android build (Nix) #148
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
| # SPDX-FileCopyrightText: 2024 Foundation Devices, Inc. <hello@foundation.xyz> | |
| # SPDX-License-Identifier: GPL-3.0-or-later | |
| name: Android build (Nix) | |
| on: | |
| workflow_call: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 2 * * *' # Run daily at 2 AM UTC | |
| jobs: | |
| nix-android-build: | |
| runs-on: [ self-hosted, Linux, X64 ] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Check if Nix is installed | |
| id: check-nix | |
| run: | | |
| if [ -d "/nix/var/nix/profiles/default/bin" ]; then | |
| echo "installed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "installed=false" >> $GITHUB_OUTPUT | |
| fi | |
| shell: bash | |
| - name: Setup Nix daemon | |
| if: steps.check-nix.outputs.installed == 'true' | |
| run: | | |
| export PATH=/nix/var/nix/profiles/default/bin:$PATH | |
| echo "PATH=/nix/var/nix/profiles/default/bin:$PATH" >> $GITHUB_ENV | |
| nix --version | |
| echo "Using existing Nix daemon" | |
| - name: Setup Nix | |
| if: steps.check-nix.outputs.installed == 'false' | |
| uses: DeterminateSystems/nix-installer-action@main | |
| - run: nix develop --command flutter pub get | |
| name: Get Flutter dependencies | |
| - run: echo -n $KEY_JKS | base64 -di > android/key.jks && nix develop --command flutter build apk --release --target-platform android-arm64 --verbose | |
| name: Build Envoy APK | |
| env: | |
| KEY_JKS: ${{ secrets.KEY_JKS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| ALIAS_PASSWORD: ${{ secrets.ALIAS_PASSWORD }} | |
| - run: echo -n $KEY_JKS | base64 -di > android/key.jks && nix develop --command flutter build aab --release --target-platform android-arm64 | |
| name: Build Envoy AAB | |
| env: | |
| KEY_JKS: ${{ secrets.KEY_JKS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| ALIAS_PASSWORD: ${{ secrets.ALIAS_PASSWORD }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-release.apk | |
| path: build/app/outputs/apk/release/app-release.apk | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-release.aab | |
| path: build/app/outputs/bundle/release/app-release.aab |