Skip to content

Commit c5a2066

Browse files
committed
config(actions): update build apk - workflows
1 parent be2a2d4 commit c5a2066

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

.github/workflows/build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build APK
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
apk:
10+
name: Generate APK
11+
needs: test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v1
16+
- name: Setup JDK
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 1.8
20+
- name: Build APK
21+
run: bash ./gradlew assembleDebug --stacktrace
22+
- name: Upload APK
23+
uses: actions/upload-artifact@v1
24+
with:
25+
name: apk
26+
path: app/build/outputs/apk/debug/app-debug.apk
27+
release:
28+
name: Release APK
29+
needs: apk
30+
if: startsWith(github.ref, 'refs/tags/v')
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Download APK from build
34+
uses: actions/download-artifact@v1
35+
with:
36+
name: apk
37+
- name: Create Release
38+
id: create_release
39+
uses: actions/create-release@v1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.TOKEN }}
42+
with:
43+
tag_name: ${{ github.ref }}
44+
release_name: Release ${{ github.ref }}
45+
- name: Upload Release APK
46+
id: upload_release_asset
47+
uses: actions/[email protected]
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.TOKEN }}
50+
with:
51+
upload_url: ${{ steps.create_release.outputs.upload_url }}
52+
asset_path: apk/app-debug.apk
53+
asset_name: ChatGPTLite.apk
54+
asset_content_type: application/zip

app/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ android {
3131

3232
buildTypes {
3333
release {
34-
minifyEnabled false
3534
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
35+
debuggable false // make app non-debuggable
36+
crunchPngs true // shrink images
37+
minifyEnabled true // obfuscate code and remove unused code
38+
shrinkResources true // shrink and remove unused resources
39+
multiDexEnabled true
3640
}
3741
}
3842
compileOptions {

0 commit comments

Comments
 (0)