-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.44 KB
/
build.yml
File metadata and controls
52 lines (44 loc) · 1.44 KB
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
name: Build APK
on:
workflow_call:
outputs:
artifact-id:
description: "The ID of the uploaded artifact"
value: ${{ jobs.build.outputs.artifact-id }}
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
outputs:
artifact-id: ${{ steps.upload-apk.outputs.artifact-id }}
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Decode Keystore
run: |
mkdir -p app/keystores
echo "${{ secrets.KEYSTORE_FILE }}" | base64 -d > ${{ github.workspace }}/app/keystores/keystore.jks
chmod 600 app/keystores/keystore.jks
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build APK
run: ./gradlew assembleRelease --stacktrace
env:
KEYSTORE_FILE: ${{ github.workspace }}/app/keystores/keystore.jks
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
- name: Upload APK
id: upload-apk
uses: actions/upload-artifact@v4
with:
name: android-package
path: app/build/outputs/apk/release/*.apk