-
-
Notifications
You must be signed in to change notification settings - Fork 12
100 lines (81 loc) · 3.33 KB
/
publish.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
name: Publish Custom App
on:
release:
types: [published]
branches:
- main
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- name: Retrieving custom app configuration
uses: actions/checkout@v3
- name: Retrieving Kiwix Android source code
run: git clone --depth=1 --single-branch --branch Issue#3505 https://github.com/kiwix/kiwix-android.git
- name: Copying custom app configuration into Kiwix Android code base
run: ./copy_files_to_kiwix_android.sh
- name: Preparing signing material
env:
keystore: ${{ secrets.keystore }}
playstore_json: ${{ secrets.PLAYSTORE_JSON }}
run: |
echo "$playstore_json" > kiwix-android/playstore.json
echo "$keystore" | base64 -d > kiwix-android/kiwix-android.keystore
- name: Set tag variable
run: echo "TAG=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
- name: Publishing app to Google Play
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION: ${{ secrets.DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION }}
run: |
cd kiwix-android
./gradlew download${TAG^}ZimAndPutInAssetFolder
bundle${TAG^}Release
publish${TAG^}ReleaseBundleWithPlayAssetDelivery
publish_dummy_apk:
runs-on: ubuntu-22.04
steps:
- name: Retrieving custom app configuration
uses: actions/checkout@v3
- name: Retrieving Kiwix Android source code
run: git clone --depth=1 --single-branch --branch develop https://github.com/kiwix/kiwix-android.git
- name: Copying custom app configuration into Kiwix Android code base
run: ./copy_files_to_kiwix_android.sh
- name: Preparing signing material
env:
keystore: ${{ secrets.keystore }}
run: |
echo "$keystore" | base64 -d > kiwix-android/kiwix-android.keystore
- name: Set tag variable
run: echo "TAG=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
- name: Should upload dummy APK
run: |
cd ${TAG}
new=$(grep -o '"new": true' info.json)
if [ -n "$new" ]; then
echo "The 'new' attribute is true, proceeding to publish dummy apk..."
else
echo "The 'new' attribute is not true, skipping the next job."
exit 0 # Skip the job as APK is already published on play store
fi
- name: Generate dummy Bundle
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION: ${{ secrets.DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION }}
run: |
cd kiwix-android
eval "./gradlew bundle${TAG^}Release"
- name: Get Bundle path
id: bundle-path
run: |
BUNDLE_PATH="kiwix-android/custom/build/outputs/bundle/${TAG}Release/*${TAG}*.aab"
echo "::set-output name=bundle_path::$BUNDLE_PATH"
- name: Upload APK as an artifact
uses: actions/upload-artifact@v2
with:
name: "Dummy Bundle for play store"
path: ${{ steps.bundle-path.outputs.bundle_path }}