-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (60 loc) · 2.19 KB
/
cd-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
name: Generate release APK and AAB
on:
push:
branches: [ "release/*/*" ]
jobs:
apk:
name: Generate release builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Decode keystore and create jks
run: echo "${{ secrets.KEY_KEYSTORE_BASE64 }}" | base64 --decode > app/keystore.jks
- name: Generate keystore.properties
run: |
cat <<EOF > keystore.properties
PEXELS_API_KEY=${{ secrets.PEXELS_API_KEY }}
KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}
KEY_ALIAS=${{ secrets.KEY_ALIAS }}
KEYSTORE_FILE=${{ secrets.KEYSTORE_FILE }}
EOF
- name: Generate file name env var
run: |
DATE=$(date +'%d.%m.%Y-%H%M%S')
BRANCH_NAME=${GITHUB_REF##*/}
MESSAGE=$(cat << EOF
PurrfectPics-release-${BRANCH_NAME}-${DATE}
EOF)
echo OUTPUT_NAME=$MESSAGE >> $GITHUB_ENV
- name: Build release APK
run: bash ./gradlew assembleRelease --stacktrace
- name: Rename APK
run:
mv "./app/build/outputs/apk/release/app-release.apk" "./app/build/outputs/apk/release/${{ env.OUTPUT_NAME }}.apk"
- name: Upload release APK
uses: actions/upload-artifact@v4
with:
name: ${{ env.OUTPUT_NAME }}-APK
path: app/build/outputs/apk/release/${{ env.OUTPUT_NAME }}.apk
- name: Build release AAB
run: bash ./gradlew bundleRelease --stacktrace
- name: Rename AAB
run:
mv "./app/build/outputs/bundle/release/app-release.aab" "./app/build/outputs/bundle/release/${{ env.OUTPUT_NAME }}.aab"
- name: Upload release AAB
uses: actions/upload-artifact@v4
with:
name: ${{ env.OUTPUT_NAME }}-AAB
path: app/build/outputs/bundle/release/${{ env.OUTPUT_NAME }}.aab
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: merged-release-artifacts
pattern: ${{ env.OUTPUT_NAME }}-*
delete-merged: true