-
Notifications
You must be signed in to change notification settings - Fork 55
111 lines (95 loc) · 3.31 KB
/
Copy pathrelease.yml
File metadata and controls
111 lines (95 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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