This repository has been archived by the owner on Jun 23, 2024. It is now read-only.
forked from VN0/BlackHole
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (81 loc) · 3.48 KB
/
flutter.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
93
94
95
96
97
98
name: Build
on:
push:
branches:
- main
env:
JAVA_VERSION: "12.x"
FLUTTER_CHANNEL: "stable"
PROPERTIES_PATH: "./android/key.properties"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# Setup Java environment in order to build the Android app.
- uses: actions/setup-java@v1
with:
java-version: ${{env.JAVA_VERSION}}
cache: "gradle"
# Gradle cache for faster builds
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
# Setup the flutter environment.
- uses: subosito/flutter-action@v2
with:
channel: ${{env.FLUTTER_CHANNEL}}
cache: true
- run: |
echo storePassword=${{ secrets.STORE_PASSWORD }} >> ${{env.PROPERTIES_PATH}}
echo keyPassword=${{ secrets.KEY_PASSWORD }} >> ${{env.PROPERTIES_PATH}}
echo keyAlias=${{ secrets.KEY_ALIAS }} >> ${{env.PROPERTIES_PATH}}
echo storeFile=/home/runner/work/Soundal/Soundal/android/app/keystore.jks >> ${{env.PROPERTIES_PATH}}
echo ${{ secrets.KEYSTORE }} | base64 --decode > /home/runner/work/Soundal/Soundal/android/app/keystore.jks
# Get flutter dependencies.
- run: flutter pub get
# Check for any formatting issues in the code.
- run: dart format --set-exit-if-changed .
# Statically analyze the Dart code for any errors.
- run: flutter analyze .
# Run widget tests for our flutter project.
- run: flutter test
# Build apk.
- run: flutter build apk --release --split-per-abi
# Upload generated apk to the artifacts.
- uses: actions/upload-artifact@v2
with:
name: app-arm64-v8a-release.apk
path: build/app/outputs/apk/release/app-arm64-v8a-release.apk
- uses: actions/upload-artifact@v2
with:
name: app-armeabi-v7a-release.apk
path: build/app/outputs/apk/release/app-armeabi-v7a-release.apk
# - name: Commit on Telegram
# uses: appleboy/telegram-action@master
# with:
# to: ${{ secrets.TELEGRAM_CHAT_ID }}
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# format: markdown
# disable_web_page_preview: true
# message: |
# New commit pushed to [${{ github.event.repository.name }}](${{ github.event.repository.html_url }}) by [${{ github.event.head_commit.author.name }}](${{ github.event.head_commit.author.html_url }}).
# Commit message: ${{ github.event.head_commit.message }}
# document: build/app/outputs/apk/release/app-arm64-v8a-release.apk, build/app/outputs/apk/release/app-armeabi-v7a-release.apk
# - name: Report failure on Telegram
# uses: appleboy/telegram-action@master
# if: ${{ failure() }}
# with:
# to: ${{ secrets.TELEGRAM_CHAT_ID }}
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# format: markdown
# disable_web_page_preview: true
# message: |
# Build Failed!! @Sangwan5688
# Commit was pushed to [${{ github.event.repository.name }}](${{ github.event.repository.html_url }}) by [${{ github.event.head_commit.author.name }}](${{ github.event.head_commit.author.html_url }}).
# Commit message: ${{ github.event.head_commit.message }}