-
Notifications
You must be signed in to change notification settings - Fork 4
146 lines (123 loc) · 4.21 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Flutter CI
on:
push:
# branches: [ master ]
pull_request:
# branches: [ master ]
jobs:
build:
runs-on: ${{matrix.runner}}
strategy:
matrix:
target: [macos-x64, windows-x64, linux-x64]
include:
# - target: macos-arm64
# os: macos
# arch: arm64
# runner: macOS-latest
- target: macos-x64
os: macos
arch: x64
runner: macOS-latest
- target: windows-x64
os: windows
arch: x64
runner: windows-latest
- target: linux-x64
os: linux
arch: x64
runner: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Linux deps
if: contains(matrix.runner, 'ubuntu')
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
sudo snap install snapcraft --classic
sudo snap install multipass --classic
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
architecture: ${{matrix.arch}} # optional, x64 or arm64
- run: flutter --version
- run: flutter pub get
- run: flutter build ${{matrix.os}}
# - name: Create MSIX installer
# if: contains(matrix.runner, 'windows')
# run: flutter pub run msix:create
- name: Download Inno Setup
uses: suisei-cn/actions-download-file@v1
if: contains(matrix.runner, 'windows')
with:
url: https://jrsoftware.org/download.php/is.exe
target: ../
- name: Install Inno Setup
if: contains(matrix.runner, 'windows')
run: '../is.exe /VERYSILENT /NORESTART /ALLUSERS'
- name: Create ISS
if: contains(matrix.runner, 'windows')
run: dart ./lib/inno_setup.dart
- name: Compile Installer
if: contains(matrix.runner, 'windows')
run: '& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /f innosetup.iss'
- name: Create MacOS App bundle
if: contains(matrix.runner, 'macos')
run: |
cd ./build/macos/Build/Products/Release/
ditto -c -k --sequesterRsrc --keepParent ./desktop_adb_file_browser.app result.zip || true
# - name: Create Snap installer
# if: contains(matrix.runner, 'ubuntu')
# run: snapcraft
# TODO: Mac artifacts
# TODO: Figure out how to fix Snap builds
# Windows
- name: Upload Windows artifacts (archive)
if: contains(matrix.runner, 'windows')
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ./build/windows/x64/runner/Release/*
if-no-files-found: error
# - name: Upload Windows MSIX installer
# if: contains(matrix.runner, 'windows')
# uses: actions/upload-artifact@v3
# with:
# name: ${{ matrix.target }} msix installer
# path: |
# ./build/windows/runner/Release/*.msix
# if-no-files-found: error
- name: Upload Windows Inno installer
if: contains(matrix.runner, 'windows')
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }} Inno installer
path: |
./build/windows/x64/runner/windows_installer.exe
if-no-files-found: error
# Linux
- name: Upload Linux artifacts (archive)
if: contains(matrix.runner, 'ubuntu')
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ./build/linux/**/release/bundle/*
if-no-files-found: error
# - name: Upload Linux snap artifacts
# if: contains(matrix.runner, 'ubuntu')
# uses: actions/upload-artifact@v3
# with:
# name: ${{ matrix.target }}
# path: ./*.snap
# if-no-files-found: error
# MacOS
- name: Upload MacOS artifacts (archive)
if: contains(matrix.runner, 'mac')
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ./build/macos/Build/Products/Release/result.zip
if-no-files-found: error