-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (47 loc) · 1.54 KB
/
Copy pathdogfood_release.yml
File metadata and controls
58 lines (47 loc) · 1.54 KB
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
name: Release dogfood to the Telegram channel
on:
workflow_dispatch:
push:
tags:
- dogfood
env:
java_version: 17
jobs:
build:
runs-on: ubuntu-latest
environment:
name: Dogfood
strategy:
matrix:
include:
- name: Main APK
gradle-command: app:assembleRelease
result: app/build/outputs/apk/release/*.apk
name: ${{ matrix.name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create secrets
run: |
echo "${{ secrets.SIGNING_KEYSTORE_BASE64 }}" | base64 --decode > app/ci-signing.jks
echo "${{ secrets.LOCAL_PROPERTIES }}" > app/local.properties
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{env.java_version}}
distribution: temurin
- name: Build ${{ matrix.name }}
run: ./gradlew ${{ matrix.gradle-command }} --stacktrace
- name: Send files to Telegram
run: |
changelog=$(cd fastlane/metadata/android/en-US/changelogs/ && cat "$(ls -rt | tail -n1)" | head -c 200)
for file in ${{ matrix.result }}; do
if [ -f "$file" ]; then
echo "Uploading $file"
curl --silent --output /dev/null --show-error --fail \
-F "document=@$file" \
-F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \
-F "caption=$changelog" \
"https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument"
fi
done