-
-
Notifications
You must be signed in to change notification settings - Fork 36
83 lines (73 loc) · 3.49 KB
/
staging-cd.yaml
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
name: Build and distribute (staging)
on:
push:
branches:
- dev
- master
- main
pull_request:
types:
- opened
- reopened
branches:
- dev
- master
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Notify contributors
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.STAGING_TELEGRAM_CHAT_ID }}
token: ${{ secrets.STAGING_TELEGRAM_BOT_TOKEN }}
format: HTML
message: |
project: ScholArxiv
build_type: Staging
commit: <a href="https://github.com/${{ github.repository }}/commit/${{ github.sha }}">${{ env.SHORT_SHA }}</a>
diff: <a href="https://github.com/${{ github.repository }}/compare/${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}">${{ env.SHORT_BASE_SHA }}...${{ env.SHORT_HEAD_SHA }}</a>
pull_request: <a href="https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}">#${{ github.event.pull_request.number }}</a>
repo: <a href="https://github.com/${{ github.repository }}">${{ github.repository }}</a>
assignedTo: ${{ secrets.ASSIGNED_TO }}
message: Built APK will be sent in a moment...
- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 17
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ secrets.FLUTTER_VERSION || env.FLUTTER_VERSION || '3.4.4' }} # goes for secrets, then environments defaults to 3.4.4
- name: Build
run: chmod +x ./scripts/build-and-filter-errors.sh && ./scripts/build-and-filter-errors.sh
- name: Send error
if: always()
uses: appleboy/telegram-action@master
with:
message: Build Output file incoming...
to: ${{ secrets.STAGING_TELEGRAM_CHAT_ID }}
token: ${{ secrets.STAGING_TELEGRAM_BOT_TOKEN }}
document: ${{ github.workspace }}/build_output.log
- name: Generate SHORT_SHA
run: |
echo "SHORT_SHA=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV
echo "SHORT_BASE_SHA=`echo ${{ github.event.pull_request.base.sha }} | cut -c1-8`" >> $GITHUB_ENV
echo "SHORT_HEAD_SHA=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-8`" >> $GITHUB_ENV
- name: Send build to Telegram group
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.STAGING_TELEGRAM_CHAT_ID }}
token: ${{ secrets.STAGING_TELEGRAM_BOT_TOKEN }}
format: HTML
message: |
version: ${{ env.BUILD_VERSION }}
client_id: ScholArxiv
build_type: Staging
commit: <a href="https://github.com/${{ github.repository }}/commit/${{ github.sha }}">${{ env.SHORT_SHA }}</a>
diff: <a href="https://github.com/${{ github.repository }}/compare/${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}">${{ env.SHORT_BASE_SHA }}...${{ env.SHORT_HEAD_SHA }}</a>
pull_request: <a href="https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}">#${{ github.event.pull_request.number }}</a>
repo: <a href="https://github.com/${{ github.repository }}">${{ github.repository }}</a>
document: ${{ github.workspace }}/build/app/outputs/flutter-apk/app-release.apk