1+ name : CI
2+ on : [push, pull_request]
3+ jobs :
4+ build :
5+ name : Build
6+ runs-on : ubuntu-18.04
7+ steps :
8+ - uses : actions/checkout@v2
9+
10+ - name : Set up JDK 1.8
11+ uses : actions/setup-java@v1
12+ with :
13+ java-version : 1.8
14+
15+ - name : Setup Android SDK
16+ uses : android-actions/setup-android@v2
17+
18+ - name : Build release
19+ run : ./gradlew assembleRelease
20+
21+ - uses : actions/upload-artifact@v2
22+ with :
23+ name : unsigned-app.apk
24+ path : app/build/outputs/apk/release/app-release-unsigned.apk
25+ if-no-files-found : error
26+
27+ deploy :
28+ name : Deploy to GitHub Releases
29+ needs : build
30+ runs-on : ubuntu-18.04
31+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
32+ steps :
33+ - name : Get the APK
34+ uses : actions/download-artifact@v2
35+ with :
36+ name : unsigned-app.apk
37+ path : .
38+
39+ - uses : r0adkll/sign-android-release@v1
40+ name : Sign the APK
41+ id : sign_app
42+ with :
43+ releaseDirectory : .
44+ signingKeyBase64 : ${{ secrets.ANDROID_SIGNING_KEY }}
45+ alias : ${{ secrets.SIGNING_KEY_ALIAS }}
46+ keyStorePassword : ${{ secrets.SIGNING_KEY_STORE_PASSWORD }}
47+ keyPassword : ${{ secrets.SIGNING_KEY_PASSWORD }}
48+
49+ - name : Publish the APK to GitHub Releases
50+ uses : svenstaro/upload-release-action@v2
51+ with :
52+ prerelease : true
53+ asset_name : httptoolkit.apk
54+ file : ${{ steps.sign_app.outputs.signedReleaseFile }}
55+ tag : ${{ github.ref }}
56+ repo_token : ${{ secrets.GITHUB_TOKEN }}
57+
58+ - name : Publish the APK to Google Play
59+ uses : r0adkll/upload-google-play@v1
60+ with :
61+ serviceAccountJsonPlainText : ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }}
62+ packageName : tech.httptoolkit.android.v1
63+ releaseFiles : ${{ steps.sign_app.outputs.signedReleaseFile }}
64+ track : production
0 commit comments