-
-
Notifications
You must be signed in to change notification settings - Fork 8
75 lines (60 loc) · 2.5 KB
/
android-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
name: Build Android Release Package
on:
workflow_dispatch:
jobs:
android-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Create Sekrets
run: |
./gradlew createSekretProperties -Pkey=GITHUB_CLIENT_ID -Pvalue=${{ secrets.GH_CLIENT_ID }};
./gradlew createSekretProperties -Pkey=GITHUB_CLIENT_SECRET -Pvalue=${{ secrets.GH_CLIENT_SECRET }};
./gradlew createSekretProperties -Pkey=FIREBASE_PROJECT -Pvalue=${{ secrets.FIREBASE_PROJECT }};
./gradlew createSekretProperties -Pkey=FIREBASE_APPLICATION -Pvalue=${{ secrets.FIREBASE_APPLICATION }};
./gradlew createSekretProperties -Pkey=FIREBASE_API_KEY -Pvalue=${{ secrets.FIREBASE_API_KEY }}
- name: Generate Sekret binary
run: ./gradlew composeApp:createSekretNativeBinary
- name: Copy Sekrets
run: ./gradlew composeApp:copySekretNativeBinary
- name: Build
continue-on-error: true
run: ./gradlew build
- name: Execute Build
run: ./gradlew composeApp:assembleRelease && ./gradlew composeApp:bundleRelease
- name: Move APK file(s)
run: mv ./composeApp/build/outputs/apk/release/*.apk ./composeApp/release/
- name: Move AAB file(s)
run: mv ./composeApp/build/outputs/bundle/release/*.aab ./composeApp/release/
- name: Remove "-unsigned" from filename(s)
run: for filename in ./composeApp/release/*-unsigned*; do mv "./$filename" "./$(echo "$filename" | sed -e 's/-unsigned//g')"; done
- uses: ilharp/sign-android-release@v1
id: sign_app
with:
releaseDir: composeApp/release
signingKey: ${{ secrets.ANDROID_SIGNING_KEY }}
keyAlias: ${{ secrets.ANDROID_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: Split signed files
uses: xom9ikk/split@v1
id: split
with:
string: ${{ steps.sign_app.outputs.signedFiles }}
separator: ':'
limit: 2
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
path: |
${{ steps.split.outputs._0 }}
${{ steps.split.outputs._1 }}
retention-days: 1