Feat/html workspace sync #165
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
| name: Build Dev Client APK | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| paths-ignore: | |
| - "README.md" | |
| - "wiki/**" | |
| - "public/**" | |
| - ".vscode" | |
| - ".idea" | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| paths-ignore: | |
| - "README.md" | |
| - "wiki/**" | |
| - "public/**" | |
| - ".vscode" | |
| - ".idea" | |
| jobs: | |
| build-dev-client: | |
| name: Build dev-client + Detox test APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22.x | |
| cache: pnpm | |
| - name: Set Up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: "zulu" | |
| java-version: "17" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| gradle-version: 8.10.2 | |
| - name: Set Build Tools Version | |
| run: | | |
| echo "BUILD_TOOLS_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | sort -V | tail -n 1)" >> $GITHUB_ENV | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - uses: actions/cache@v5 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Type check, lint, and unit test | |
| run: | | |
| pnpm run check | |
| pnpm run lint | |
| pnpm run test:unit | |
| - uses: actions/cache@v5 | |
| name: Cache Gradle Wrapper and Dependencies | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Build tw plugins & scripts | |
| run: | | |
| pnpm run build:plugin | |
| pnpm run build:tw-assets | |
| pnpm run build:wiki-template | |
| - name: Install expo-dev-client | |
| run: pnpm install expo-dev-client -w | |
| # Modify app.json for dev-client to use different package name and app name | |
| - name: Modify app.json for dev-client | |
| run: | | |
| node -e " | |
| const fs = require('fs'); | |
| const appJson = JSON.parse(fs.readFileSync('app.json', 'utf8')); | |
| appJson.expo.name = 'TidGi Test'; | |
| appJson.expo.android.package = 'ren.onetwo.tidgi.mobile.test'; | |
| appJson.expo.ios.bundleIdentifier = 'ren.onetwo.tidgi.mobile.test'; | |
| fs.writeFileSync('app.json', JSON.stringify(appJson, null, 2)); | |
| " | |
| - name: Expo prebuild (dev-client) | |
| run: pnpm exec expo prebuild -p android --clean | |
| - name: Save Android prebuild diagnostics (dev-client) | |
| run: | | |
| mkdir -p /tmp/apk-artifacts | |
| cp android/app/src/main/AndroidManifest.xml /tmp/apk-artifacts/AndroidManifest-dev-client.xml | |
| cp android/app/build.gradle /tmp/apk-artifacts/app-build.gradle | |
| grep -nE "coreLibraryDesugaring|desugar_jdk_libs|compileOptions" android/app/build.gradle || true | |
| - name: Build dev-client APK (debug + androidTest) | |
| run: | | |
| cd android | |
| ./gradlew assembleDebug :app:assembleAndroidTest --no-daemon --warning-mode all -DtestBuildType=debug | |
| - name: Collect APKs into flat staging dir | |
| run: | | |
| mkdir -p /tmp/apk-artifacts | |
| mv android/app/build/outputs/apk/debug/app-debug.apk /tmp/apk-artifacts/app-release-dev-client.apk | |
| mv android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk /tmp/apk-artifacts/app-debug-androidTest.apk | |
| - name: Upload dev-client APK artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: dev-client-apks-${{ github.run_number }}-${{ github.sha }} | |
| path: | | |
| /tmp/apk-artifacts/app-release-dev-client.apk | |
| /tmp/apk-artifacts/app-debug-androidTest.apk | |
| if-no-files-found: warn | |
| - name: Create Release (dev-client APKs) | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| draft: true | |
| generate_release_notes: false | |
| files: | | |
| /tmp/apk-artifacts/app-release-dev-client.apk | |
| /tmp/apk-artifacts/app-debug-androidTest.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |