-
Notifications
You must be signed in to change notification settings - Fork 15
127 lines (100 loc) · 3.26 KB
/
github_release.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Build Release
on: push
jobs:
archive_project:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: montudor/action-zip@v1
with:
args: zip -qq -r source_code.zip . -x "*.git*"
- uses: actions/upload-artifact@v2
with:
name: source_code.zip
path: source_code.zip
build_documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Pub Get
run: flutter pub get
- name: Install dartdoc
run: flutter pub global activate dartdoc
- name: Build documentation
run: flutter pub global run dartdoc
- name: Release the documentation
uses: crazy-max/ghaction-github-pages@v3
if: success()
with:
target_branch: documentation
build_dir: doc/api
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_web_example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Pub Get
run: flutter pub get
- name: Build web example
run: cd example && flutter build web --release --web-renderer=html
- name: Release the documentation
uses: crazy-max/ghaction-github-pages@v3
if: success()
with:
target_branch: web_example
build_dir: example/build/web
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_android_example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 12
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Pub Get
run: flutter pub get
- name: Build android example
run: cd example && flutter build apk --split-per-abi --release
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: publish-artifacts
path: example/build/app/outputs/flutter-apk/*.apk
publish:
runs-on: ubuntu-latest
needs: [archive_project, build_android_example]
steps:
- uses: actions/checkout@v2
- name: Initialize project version
id: project_version
uses: its404/[email protected]
- name: Download archived project
uses: actions/download-artifact@v2
with:
name: source_code.zip
path: source_code.zip
- name: Download apks
uses: actions/download-artifact@v2
with:
name: publish-artifacts
path: example/build/app/outputs/flutter-apk
- name: Release the APKs
uses: ncipollo/release-action@v1
with:
artifacts: "example/build/app/outputs/flutter-apk/*.apk, source_code.zip"
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ steps.project_version.outputs.version_number }}+${{ steps.project_version.outputs.build_number }}
name: "v${{ steps.project_version.outputs.version_number }}+${{ steps.project_version.outputs.build_number }}"