fix(mobile): polish auth and settings ux #1389
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: π€ Build Android | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| paths: | |
| - "apps/mobile/**" | |
| - "pnpm-lock.yaml" | |
| workflow_dispatch: | |
| inputs: | |
| profile: | |
| type: choice | |
| default: preview | |
| options: | |
| - preview | |
| - production | |
| description: "Build profile" | |
| release: | |
| type: boolean | |
| default: false | |
| description: "Create a release draft for the build" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.profile }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build Android apk for device | |
| if: github.secret_source != 'None' && (github.event_name != 'push' || !contains(github.event.head_commit.message || '', 'release(mobile):')) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π§Ή Claim disk space | |
| run: | | |
| df -h / | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/.ghcup | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo rm -rf /usr/share/swift | |
| sudo rm -rf /usr/local/julia* | |
| df -h / | |
| - name: π¦ Checkout code | |
| uses: actions/checkout@v6 | |
| - name: π¦ Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: π Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: "17" | |
| distribution: "zulu" | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: π± Setup EAS | |
| uses: expo/expo-github-action@v8 | |
| with: | |
| eas-version: latest | |
| token: ${{ secrets.EXPO_TOKEN }} | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: π¨ Build Android app | |
| working-directory: apps/mobile | |
| run: eas build --platform android --profile ${{ github.event.inputs.profile || 'preview' }} --local --output=${{ github.workspace }}/build.${{ github.event.inputs.profile == 'production' && 'aab' || 'apk' }} | |
| - name: π€ Upload apk Artifact | |
| if: github.event.inputs.profile != 'production' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: app-android | |
| path: ${{ github.workspace }}/build.apk | |
| retention-days: 90 | |
| - name: π€ Upload aab Artifact | |
| if: github.event.inputs.profile == 'production' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: aab-android | |
| path: ${{ github.workspace }}/build.aab | |
| retention-days: 90 | |
| - name: Submit to Google Play | |
| if: github.event.inputs.profile == 'production' | |
| working-directory: apps/mobile | |
| run: eas submit --platform android --path ${{ github.workspace }}/build.aab --non-interactive | |
| - name: Setup Version | |
| if: github.event.inputs.release == 'true' | |
| id: version | |
| uses: ./.github/actions/setup-version | |
| with: | |
| type: "mobile" | |
| - name: Prepare Release Notes | |
| if: github.event.inputs.release == 'true' | |
| id: release_notes | |
| run: | | |
| version="${{ steps.version.outputs.APP_VERSION }}" | |
| changelog_file="apps/mobile/changelog/${version}.md" | |
| release_notes_file="$RUNNER_TEMP/mobile-release-notes.md" | |
| if [ -f "$changelog_file" ]; then | |
| cp "$changelog_file" "$release_notes_file" | |
| else | |
| { | |
| echo "# What's New in v${version}" | |
| echo | |
| echo "- No changelog file found at ${changelog_file}." | |
| } > "$release_notes_file" | |
| fi | |
| echo "body_path=${release_notes_file}" >> "$GITHUB_OUTPUT" | |
| - name: Create Release Draft | |
| if: github.event.inputs.release == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Mobile v${{ steps.version.outputs.APP_VERSION }} | |
| draft: true | |
| prerelease: true | |
| tag_name: mobile/v${{ steps.version.outputs.APP_VERSION }} | |
| body_path: ${{ steps.release_notes.outputs.body_path }} | |
| # .aab cannot be installed directly on your Android Emulator or device. | |
| files: ${{ github.workspace }}/build.apk |