forked from LawnchairLauncher/lawnicons
-
Notifications
You must be signed in to change notification settings - Fork 19
84 lines (82 loc) · 2.73 KB
/
build_release_apk.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
name: Build release APK
on:
workflow_dispatch:
push:
branches:
- main-wip
jobs:
build-release-apk:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Check out repository
uses: actions/checkout@v2.3.4
with:
submodules: true
- name: Restore Gradle cache
uses: actions/cache@v2.1.4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Set up Java 11
uses: actions/setup-java@v1.4.3
with:
java-version: 11
- name: Grant execution permission to Gradle Wrapper
run: chmod +x gradlew
- name: Build release APK
run: ./gradlew assembleRelease
- name: Sign release APK
uses: r0adkll/sign-android-release@v1
id: sign-release-apk
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Rename artifact
run: |
oldArtifactPath="${{ steps.sign-release-apk.outputs.signedReleaseFile }}"
newArtifactPath="${oldArtifactPath%'-unsigned-signed.apk'}.apk"
echo "ARTIFACT_PATH=$newArtifactPath" >> $GITHUB_ENV
mv "$oldArtifactPath" "$newArtifactPath"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: Release APK
path: ${{ env.ARTIFACT_PATH }}
send-notifications:
runs-on: ubuntu-latest
needs: build-release-apk
steps:
- name: Check out repository
uses: actions/checkout@v2.3.4
with:
submodules: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install gitpython requests
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: Release APK
path: artifacts/release-apk
- name: Send notifications
run: python send_notifications.py
env:
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
TELEGRAM_CI_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }}
TELEGRAM_CI_CHANNEL_ID: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }}
TELEGRAM_TEAM_GROUP_ID: ${{ secrets.TELEGRAM_TEAM_GROUP_ID }}
ARTIFACT_DIRECTORY: artifacts/release-apk
GITHUB_REF: ${{ github.ref }}