-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (81 loc) · 2.7 KB
/
publishAndroidProd.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
name: Publish Android Prod
concurrency:
group: publish-android-prod
cancel-in-progress: true
on:
push:
tags:
- 'android/*.*.*'
- '!android/*.*.*-*'
jobs:
publish-android-prod:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Extract keystore
run: |
cd androidApp
echo "${{ secrets.KEYS_TAR_ASC }}" > .keys.tar.gz.asc
gpg -d --passphrase "${{ secrets.KEYS_PASSPHRASE }}" --batch .keys.tar.gz.asc > .keys.tar.gz
tar xzf .keys.tar.gz
cd ..
- name: Release Android Prod
run: ./gradlew publishProdReleaseApps --no-daemon -PkeyPassword=${{ secrets.KEY_PASSWORD }} -PstorePassword=${{ secrets.STORE_PASSWORD }}
env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3g"
- name: Add version to env
run: |
ANDROID_VERSION=$(cat androidApp/build/version.tag)
echo "ANDROID_VERSION=${ANDROID_VERSION}" >> $GITHUB_ENV
echo "VERSION_TAG=android/${ANDROID_VERSION}" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_gh_release
uses: softprops/action-gh-release@v2
with:
name: Android ${{ env.ANDROID_VERSION }}
tag_name: ${{ env.VERSION_TAG }}
prerelease: true # As the release is not yet available on the Play Store
generate_release_notes: true
- name: Slack notification
run: |
curl -X POST \
--header 'Content-type: application/json' \
--url '${{ secrets.SLACK_WEB_HOOK_URL }}' \
--data '{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "🚀 New Android pre release available",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Version:* `'${{ env.ANDROID_VERSION }}'`"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<${{ steps.create_gh_release.outputs.url }}|See what's new>"
}
}
]
}'