.github/workflows/build.yml (2589 bytes)
1 name: Build 2 3 "on": 4 push: 5 branches: [main] 6 workflow_dispatch: 7 8 permissions: 9 contents: read 10 11 concurrency: 12 group: build-${{ github.ref }} 13 cancel-in-progress: true 14 15 jobs: 16 apk: 17 name: Test the engine, build the APK 18 runs-on: ubuntu-latest 19 timeout-minutes: 60 20 21 env: 22 CMAKE_VERSION: "3.31.6" 23 NDK_VERSION: "29.0.14206865" 24 # The speech model is in git. The hash says that it is the file of the whisper.cpp project. 25 MODEL_SHA256: c2085835d3f50733e2ff6e4b41ae8a2b8d8110461e18821b09a15c40c42d1cca 26 27 steps: 28 - name: Checkout 29 uses: actions/checkout@v4 30 with: 31 submodules: recursive 32 fetch-depth: 1 33 34 - name: Set up JDK 35 uses: actions/setup-java@v4 36 with: 37 distribution: temurin 38 java-version: "21" 39 40 - name: Set up Android SDK 41 uses: android-actions/setup-android@v3 42 with: 43 packages: platform-tools 44 45 - name: Install Android build tools 46 run: | 47 set -euo pipefail 48 sdkmanager "platforms;android-36" "build-tools;36.0.0" \ 49 "cmake;${CMAKE_VERSION}" "ndk;${NDK_VERSION}" 50 51 - name: Set up Gradle 52 uses: gradle/actions/setup-gradle@v4 53 54 - name: Verify the speech model 55 run: echo "${MODEL_SHA256} app/src/main/assets/models/ggml-tiny-q8_0.bin" | sha256sum -c - 56 57 - name: Test the alignment engine 58 run: ./gradlew --no-daemon :core:test 59 60 - name: Unpack the signing key 61 env: 62 KEYSTORE_B64: ${{ secrets.SUBREAD_KEYSTORE_B64 }} 63 run: | 64 set -euo pipefail 65 if [ -n "${KEYSTORE_B64}" ]; then 66 echo "${KEYSTORE_B64}" | base64 -d > "${RUNNER_TEMP}/subread.jks" 67 echo "SUBREAD_KEYSTORE_FILE=${RUNNER_TEMP}/subread.jks" >> "${GITHUB_ENV}" 68 else 69 echo "::warning::No signing key configured; the APK will be unsigned and will not install." 70 fi 71 72 - name: Build the APK 73 env: 74 SUBREAD_KEYSTORE_PASSWORD: ${{ secrets.SUBREAD_KEYSTORE_PASSWORD }} 75 run: ./gradlew --no-daemon :app:assembleRelease 76 77 - name: Upload the APK 78 uses: actions/upload-artifact@v4 79 with: 80 name: subread-apk 81 path: app/build/outputs/apk/release/*.apk 82 if-no-files-found: error 83 84 - name: Upload test reports 85 if: failure() 86 uses: actions/upload-artifact@v4 87 with: 88 name: reports 89 path: | 90 core/build/reports/tests 91 app/build/outputs/logs 92 if-no-files-found: ignore