forked from leo-hydraulic/flutter-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.4 KB
/
build.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
name: Flutter Build
on: [push, workflow_dispatch, workflow_call]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- arch: aarch64
os: macos-11
target: macos
lipo-arch: arm64
- arch: amd64
os: macos-11
target: macos
lipo-arch: x86_64
- arch: amd64
os: windows-2019
target: windows
- arch: amd64
os: ubuntu-20.04
target: linux
name: ${{ matrix.target }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.3.10'
channel: 'stable'
cache: true
- if: ${{ matrix.target == 'linux' }}
name: 'Linux: Install GTK-3'
run: sudo apt-get install -y libgtk-3-dev
- if: ${{ matrix.target == 'linux' }}
name: 'Linux: Install Ninja'
uses: turtlesec-no/get-ninja@main
- name: Build
run: flutter build ${{ matrix.target }} --release -v
- if: ${{ matrix.target == 'macos' }}
name: 'MacOS: Thin binary'
run: >-
lipo build/macos/Build/Products/Release/flutter_demo.app/Contents/MacOS/flutter_demo
-output build/macos/Build/Products/Release/flutter_demo.app/Contents/MacOS/flutter_demo
-thin ${{ matrix.lipo-arch }}
- if: ${{ matrix.target == 'windows' }}
name: 'Windows: Upload artifact'
uses: actions/upload-artifact@v3
with:
name: build-${{ matrix.target }}-${{ matrix.arch }}
path: build/windows/runner/Release
- if: ${{ matrix.target == 'macos' }}
name: 'MacOS: Tar results'
run: >-
tar cvf build-${{ matrix.target }}-${{ matrix.arch }}.tar
-C build/macos/Build/Products/Release flutter_demo.app
- if: ${{ matrix.target == 'linux' }}
name: 'Linux: Tar results'
run: >-
tar cvf build-${{ matrix.target }}-${{ matrix.arch }}.tar
-C build/linux/*/release bundle
- if: ${{ matrix.target != 'windows' }}
name: 'Upload Tar'
uses: actions/upload-artifact@v3
with:
name: build-${{ matrix.target }}-${{ matrix.arch }}
path: build-${{ matrix.target }}-${{ matrix.arch }}.tar