-
Notifications
You must be signed in to change notification settings - Fork 3
146 lines (125 loc) · 5.3 KB
/
app-dev-build.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Android Build
on:
pull_request:
branches:
- master
- develop
workflow_dispatch:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Extract repository name
id: repo-name
run: echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV
- name: Extract version name
id: version_name
run: |
VERSION_NAME=$(grep -oP 'versionName\s*=\s*"\K[^"]+' ./app/build.gradle.kts)
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install Android Build Tools
run: sdkmanager "build-tools;29.0.3"
- name: Extract formatted build date
run: echo "BUILD_DATE=$(date -u '+%Y%m%d%H')" >> $GITHUB_ENV
- name: Inject Secrets into config.properties
run: |
echo "api_id=${{ secrets.API_ID }}" > app/src/main/assets/config.properties
echo "api_hash=${{ secrets.API_HASH }}" >> app/src/main/assets/config.properties
echo "BUILD_DATE=${{ env.BUILD_DATE }}" >> app/src/main/assets/config.properties
echo "BETA=true" >> app/src/main/assets/config.properties
- uses: gradle/gradle-build-action@v3
with:
gradle-version: 8.9
arguments: assembleRelease
- name: Sign ARM APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/arm/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Move ARM APK
run: mv app/build/outputs/apk/arm/release/app-arm-release-unsigned-signed.apk ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-arm.apk
- name: Sign ARM64 APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/arm64/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Move ARM64 APK
run: mv app/build/outputs/apk/arm64/release/app-arm64-release-unsigned-signed.apk ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-arm64.apk
- name: Sign X86 APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/x86/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Move X86 APK
run: mv app/build/outputs/apk/x86/release/app-x86-release-unsigned-signed.apk ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-x86.apk
- name: Sign x86_64 APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/x86_64/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Move x86_64 APK
run: mv app/build/outputs/apk/x86_64/release/app-x86_64-release-unsigned-signed.apk ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-x86_64.apk
- name: Sign Universal APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/universal/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Move Universal APK
run: mv app/build/outputs/apk/universal/release/app-universal-release-unsigned-signed.apk ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-universal.apk
- name: Upload APKs as artifact
uses: actions/upload-artifact@v3
with:
name: android-build-apk-arm
path: ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-arm.apk
retention-days: 90
- name: Upload APKs as artifact
uses: actions/upload-artifact@v3
with:
name: android-build-apk-arm64
path: ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-arm64.apk
retention-days: 90
- name: Upload APKs as artifact
uses: actions/upload-artifact@v3
with:
name: android-build-apk-x86
path: ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-x86.apk
retention-days: 90
- name: Upload APKs as artifact
uses: actions/upload-artifact@v3
with:
name: android-build-apk-x86_64
path: ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-x86_64.apk
retention-days: 90
- name: Upload APKs as artifact
uses: actions/upload-artifact@v3
with:
name: android-build-apk-universal
path: ${{ env.REPO_NAME }}-v${{ env.VERSION_NAME }}-universal.apk
retention-days: 90