Add signed release APK build to CI workflow #14
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 & Lint | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }} | |
| restore-keys: gradle- | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Decode keystore | |
| run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > keystore.jks | |
| - name: Create keystore.properties | |
| run: | | |
| cat > keystore.properties <<EOF | |
| storeFile=keystore.jks | |
| storePassword=${{ secrets.KEYSTORE_PASSWORD }} | |
| keyAlias=${{ secrets.KEY_ALIAS }} | |
| keyPassword=${{ secrets.KEY_PASSWORD }} | |
| EOF | |
| - name: Build release APK | |
| run: ./gradlew assembleRelease | |
| - name: Upload release APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: groq-android-release | |
| path: app/build/outputs/apk/release/app-release.apk | |
| - name: Build debug APK | |
| run: ./gradlew assembleDebug | |
| - name: Upload debug APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: groq-android-debug | |
| path: app/build/outputs/apk/debug/app-debug.apk | |
| - name: Run lint | |
| run: ./gradlew lintDebug | |
| - name: Upload lint results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-results | |
| path: app/build/reports/lint-results-debug.html |