-
-
Notifications
You must be signed in to change notification settings - Fork 68
112 lines (109 loc) · 3.83 KB
/
android.yml
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
112
name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
apk:
name: Generate APK
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup JDK
uses: actions/[email protected]
with:
distribution: temurin
java-version: "17"
- name: Set execution flag for gradlew
run: chmod +x gradlew
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Install Android Build Tools
run: sdkmanager "build-tools;29.0.3"
- name: Run common unit tests
run: bash ./gradlew :common:cleanTestDebugUnitTest :common:testDebugUnitTest
- name: Build Release AAB
id: buildRelease
run: ./gradlew bundleRelease
- name: Sign AAB
id: sign
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: android/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.KEYSTORE_B64 }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEYSTORE_PASSWORD }}
- name: Upload AAB to Play Store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.inspiredandroid.linuxcommandbibliotheca
releaseFiles: android/build/outputs/bundle/release/android-release.aab
track: beta
status: draft
mappingFile: android/build/outputs/mapping/release/mapping.txt
- name: Build APK
run: bash ./gradlew assembleRelease --stacktrace
- name: Sign APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: android/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEYSTORE_B64 }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEYSTORE_PASSWORD }}
- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: apk
path: android/build/outputs/apk/release/android-release-unsigned-signed.apk
- name: Build cli JAR
run: bash ./gradlew :cli:createJar
- name: Upload cli JAR
uses: actions/upload-artifact@v1
with:
name: jar
path: cli/build/libs/linuxcommandlibrary.jar
release:
name: Release APK and JAR
needs: apk
runs-on: ubuntu-latest
steps:
- name: Download APK from build
uses: actions/download-artifact@v1
with:
name: apk
- name: Download JAR from build
uses: actions/download-artifact@v1
with:
name: jar
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Upload Github Release APK
id: upload_release_asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: apk/android-release-unsigned-signed.apk
asset_name: ${{ github.event.repository.name }}.apk
asset_content_type: application/zip
- name: Upload Github Release cli JAR
id: upload_release_asset2
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: jar/linuxcommandlibrary.jar
asset_name: linuxcommandlibrary.jar
asset_content_type: application/zip