-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (60 loc) · 2.2 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
name: Release
on:
workflow_dispatch:
push:
tags:
- '**'
jobs:
ci:
name: Release Build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checking out branch
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
# This will decode the keystore from base 64 text representation that we have stored in secrets
# and generates and keystore file and gets stored in /android-app path
- name: Decode Keystore
env:
ENCODED_STRING: ${{ secrets.KEYSTORE_BASE_64 }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
run: |
echo $ENCODED_STRING > keystore-b64.txt
mkdir -p keystore
base64 -d keystore-b64.txt > keystore/keystore.jks
- name: Ensure gradlew execute flags
run: |
chmod +x ./gradlew
- name: Build Release apk
env:
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
run: ./gradlew assembleRelease --stacktrace
- name: Build Release bundle
env:
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
run: ./gradlew bundleRelease --stacktrace
- name: Get release file apk path
id: releaseApk
run: echo "apkfile=$(find app/build/outputs/apk/release/*.apk)" >> $GITHUB_OUTPUT
- name: Create Draft Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ steps.releaseApk.outputs.apkfile }}
draft: true
prerelease: true
generate_release_notes: true