-
Notifications
You must be signed in to change notification settings - Fork 34
51 lines (40 loc) · 1.4 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
name: Test, Build & Release
on:
push:
branches: [ main ]
jobs:
release:
name: Test, Build & Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '12.x'
- name: Setup Flutter
uses: subosito/flutter-action@v1
with:
channel: stable
- name: Cache pub dependencies
uses: actions/cache@v2
with:
path: ${{ env.FLUTTER_HOME }}/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: ${{ runner.os }}-pub-
- name: Download pub dependencies
run: flutter pub get
- name: Run Unit Testing
run: flutter test test/uri_to_file_test.dart
- name: Create App Version Env
run: echo 'APP_VERSION'=`awk '/version:/ || /version:/{print}' ./pubspec.yaml | awk -F' ' '{print $2}' | awk -F'+' '{print $1}'` >> $GITHUB_ENV
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 'v${{ env.APP_VERSION }}'
release_name: 'Release v${{ env.APP_VERSION }}'
draft: false
prerelease: false