-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (90 loc) · 3.09 KB
/
pipeline.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
99
100
name: Pipeline
on:
push:
branches: [ master, release, develop ]
pull_request:
branches: [ master, release, develop ]
env:
flutter_version: "2.0.1"
java_version: "12.x"
ruby-version: "2.7.2"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: ${{ env.java_version }}
- uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.flutter_version }}
- run: flutter pub get
- run: flutter test
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ env.java_version }}
- uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.flutter_version }}
- run: flutter pub get
- run: flutter build appbundle -t lib/environments/integration.dart --debug
- run: flutter build apk -t lib/environments/integration.dart --debug
- uses: actions/cache@v2
with:
path: ./build/app/outputs/apk/debug/app-debug.apk
key: ${{ github.sha }}
tag:
runs-on: ubuntu-latest
needs: [test, build]
steps:
- uses: actions/checkout@v2
- name: Create a new tag
id: tag_version
uses: jacopocarlini/[email protected]
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Create a GitHub release
uses: actions/create-release@v1
if: ${{ steps.tag_version.outputs.tagname }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.tagname }}
release_name: v${{ steps.tag_version.outputs.tagname }}
body: ${{ steps.tag_version.outputs.tagmessage }}
- uses: actions/cache@v2
if: ${{ steps.tag_version.outputs.tagname }}
with:
path: ./build/app/outputs/apk/debug/app-debug.apk
key: ${{ github.sha }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
id: upload_release_asset
if: ${{ steps.tag_version.outputs.tagname }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build/app/outputs/apk/debug/app-debug.apk
asset_name: app-debug.apk
asset_content_type: application/apk
deploy:
if: github.ref != 'refs/heads/develop'
runs-on: ubuntu-latest
needs: [test, build]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby-version }}
- uses: maierj/[email protected]
with:
lane: 'deploy'
subdirectory: 'android'