-
-
Notifications
You must be signed in to change notification settings - Fork 464
78 lines (66 loc) · 2.75 KB
/
release.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
name: Publish App
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set tag variable
run: echo "TAG=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
- name: Retrieve date from git revision
id: git_head_revision_date
run: |
DATE=$(git log -1 --format=%cd --date=format:%Y-%m-%d)
echo "KIWIX_ANDROID_RELEASE_DATE=$DATE" >> $GITHUB_ENV
shell: bash
- name: Retrieve secrets to files
env:
KEYSTORE: ${{ secrets.keystore }}
SSH_KEY: ${{ secrets.ssh_key }}
run: |
echo "$KEYSTORE" | base64 -d > kiwix-android.keystore
echo "$SSH_KEY" | base64 -d > ssh_key
chmod 600 ssh_key
- name: Publish APK to download.kiwix.org
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
UNIVERSAL_RELEASE_APK: app/build/outputs/apk/standalone/*universal*.apk
ARCHIVE_NAME: org.kiwix.kiwixmobile.standalone-${{ github.event.release.tag_name }}.apk
KIWIX_ANDROID_RELEASE_DATE: ${{ env.KIWIX_ANDROID_RELEASE_DATE }}
run: |
./gradlew assembleStandalone
cp ${UNIVERSAL_RELEASE_APK} ${ARCHIVE_NAME}
scp -P 30022 -vrp -i ssh_key -o StrictHostKeyChecking=no "$ARCHIVE_NAME" ci@master.download.kiwix.org:/data/download/release/kiwix-android/
# This is temporary, once we will publish 3.7.0 then we will uncommented this code.
# # This is necessary for F-Droid
# - name: Publish "versionInfo" to download.kiwix.org
# run: |
# ./gradlew generateVersionCodeAndName
# scp -P 30022 -vrp -i ssh_key -o StrictHostKeyChecking=no VERSION_INFO ci@master.download.kiwix.org:/data/download/release/kiwix-android/
- name: Upload APKs to Release
uses: ncipollo/release-action@v1
with:
artifacts: "app/build/outputs/apk/standalone/**"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.TAG }}
allowUpdates: true
replacesArtifacts: true
- name: Publish bundle to Google Play
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
PLAYSTORE_JSON: ${{ secrets.PLAYSTORE_JSON }}
KIWIX_ANDROID_RELEASE_DATE: ${{ env.KIWIX_ANDROID_RELEASE_DATE }}
run: |
echo "$PLAYSTORE_JSON" > playstore.json
./gradlew publishPlayStoreBundle --scan