Fix build issue #3
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: Release | |
| on: | |
| push: | |
| tags: ['v*'] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - uses: gradle/actions/setup-gradle@v6 | |
| - name: Decode release keystore | |
| env: | |
| KEYSTORE_BASE64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }} | |
| run: echo "$KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/release.keystore" | |
| - name: Build release artifacts | |
| env: | |
| KEYSTORE_FILE: ${{ runner.temp }}/release.keystore | |
| KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
| run: ./gradlew :app:assembleGoogleRelease :app:assembleRegularRelease | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: google-apk | |
| path: app/build/outputs/apk/google/release/app-google-release.apk | |
| if-no-files-found: error | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: regular-apk | |
| path: app/build/outputs/apk/regular/release/app-regular-release.apk | |
| if-no-files-found: error | |
| smoke-test: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: google-apk | |
| path: . | |
| - name: Launch emulator and verify app starts | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 34 | |
| target: google_apis | |
| arch: x86_64 | |
| profile: pixel_6 | |
| disable-animations: true | |
| script: | | |
| adb wait-for-device | |
| adb install -r app-google-release.apk | |
| adb shell am start -W -n com.tananaev.logcat/com.tananaev.logcat.GoogleActivity | |
| sleep 10 | |
| adb shell screencap -p /sdcard/launch.png | |
| adb pull /sdcard/launch.png launch.png | |
| adb shell pidof com.tananaev.logcat > /dev/null || { echo "App process not running after launch — crashed."; exit 1; } | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: launch-screenshot | |
| path: launch.png | |
| if-no-files-found: error | |
| publish: | |
| needs: smoke-test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: google-apk | |
| path: google-apk | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: regular-apk | |
| path: regular-apk | |
| - name: Upload to Google Play (production) | |
| uses: r0adkll/upload-google-play@v1 | |
| with: | |
| serviceAccountJsonPlainText: ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }} | |
| packageName: com.tananaev.logcat | |
| releaseFiles: google-apk/app-google-release.apk | |
| track: production | |
| status: completed | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: regular-apk/app-regular-release.apk |