Merge pull request #869 from KazumaProject/feature/zero-query-2 #470
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: Android Release CI | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| ZENZ_MODEL_CACHE_DIR: ${{ github.workspace }}/.zenz-model-cache | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v3 | |
| with: | |
| log-accepted-android-sdk-licenses: true | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Cache Zenz model | |
| uses: actions/cache@v4 | |
| with: | |
| path: .zenz-model-cache | |
| key: ${{ runner.os }}-zenz-model-v1-a728931c8b4867a53ca33d1ff3fe7360b0f15cd5-Q5_K_M-ggml-model-Q5_K_M.gguf | |
| - name: Decode JKS from Base64 | |
| run: | | |
| echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > my-release-key.jks | |
| - name: Add signing info to local.properties | |
| run: | | |
| if [ ! -f local.properties ]; then | |
| touch local.properties | |
| fi | |
| KEYSTORE_PATH=$(pwd)/my-release-key.jks | |
| echo "# --- SigningConfig for CI ---" >> local.properties | |
| echo "KEYSTORE_FILE=$KEYSTORE_PATH" >> local.properties | |
| echo "KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> local.properties | |
| echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> local.properties | |
| echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> local.properties | |
| - name: Build Release Variants | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| ./gradlew clean \ | |
| :app:assembleFullStandardRelease \ | |
| -PsplitApks \ | |
| --stacktrace \ | |
| --no-daemon \ | |
| --max-workers=1 | |
| ./gradlew :app:assembleLiteStandardRelease \ | |
| -PsplitApks \ | |
| --stacktrace \ | |
| --no-daemon \ | |
| --max-workers=1 | |
| ./gradlew :app:assembleLiteFdroidRelease \ | |
| --stacktrace \ | |
| --no-daemon \ | |
| --max-workers=1 | |
| - name: Create Release and Upload APK | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| generate_release_notes: true | |
| files: app/build/outputs/apk/**/*.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |