docs(readme): align the concrete example with the demo video (World C… #17
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: Android APK | |
| # Builds a debug-signed, installable APK from a clean runner. | |
| # All build artifacts (bare/qvac bundles and the android/ directory) are | |
| # gitignored, so this workflow regenerates them from source before Gradle runs. | |
| # Models (*.gguf) are downloaded by the app at first launch, not at build time. | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main # rebuild the APK on every commit to main | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write # required to attach the APK to a GitHub Release on tag builds | |
| # One build per ref at a time: a newer commit cancels the in-progress build so | |
| # stale APKs don't pile up. Tag builds get their own group so a release build is | |
| # never cancelled by a later commit to main. | |
| concurrency: | |
| group: android-apk-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # full history so `git rev-list --count` yields a real versionCode | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: package.json # reads engines.node, no pinned version | |
| cache: npm | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install dependencies | |
| run: npm install --legacy-peer-deps | |
| - name: Build Bare P2P worker | |
| run: npm run build:bare | |
| - name: Bundle QVAC SDK worker | |
| run: npx qvac bundle sdk | |
| - name: Resolve app version (tag → versionName, commit count → versionCode) | |
| # The git tag is the single source of truth for releases — no version | |
| # bump is committed. app.config.js reads these env vars at prebuild time. | |
| run: | | |
| if [ "${GITHUB_REF_TYPE}" = "tag" ]; then | |
| # Tag "vX.Y.Z" → versionName "X.Y.Z" (strip the leading "v"). | |
| echo "RESONANCE_VERSION_NAME=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV" | |
| fi | |
| # Commit count is strictly increasing across history → a valid, | |
| # monotonic Android versionCode without manual bookkeeping. | |
| echo "RESONANCE_VERSION_CODE=$(git rev-list --count HEAD)" >> "$GITHUB_ENV" | |
| - name: Expo prebuild (generate android/) | |
| run: npx expo prebuild --platform android --clean | |
| - name: Install the NDK pinned by the generated gradle config | |
| run: | | |
| NDK_VERSION=$(grep -oP 'ndkVersion\s*=\s*"\K[^"]+' android/build.gradle) | |
| echo "Installing NDK ${NDK_VERSION} (read from android/build.gradle)" | |
| sdkmanager --install "ndk;${NDK_VERSION}" | |
| - name: Build release APK | |
| run: ./gradlew assembleRelease --no-daemon | |
| working-directory: android | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: resonance-apk | |
| path: android/app/build/outputs/apk/release/*.apk | |
| if-no-files-found: error | |
| - name: Attach APK to GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: android/app/build/outputs/apk/release/*.apk |