-
Notifications
You must be signed in to change notification settings - Fork 130
155 lines (153 loc) · 5.03 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
147
148
149
150
151
152
153
154
155
name: Build
on:
pull_request:
push:
# Due to a flutter bug, flutter build is not generating localizations
# workaround by always running flutter pub get immediately before building,
# and performing build for msix:create manually to allow implementing this workaround
jobs:
# test:
# name: Run Tests
# runs-on: ubuntu-latest
# steps:
# - name: Clone repository
# uses: actions/checkout@v4
# - uses: actions/setup-java@v4
# with:
# distribution: 'zulu'
# java-version: '17'
# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y build-essential cmake ninja-build libgtk-3-dev
# - name: Set up Flutter
# uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# - run: flutter doctor
# - run: flutter pub get
# - run: flutter test
build-android:
name: Build for Android
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build libgtk-3-dev
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter doctor
- run: flutter pub get
- run: flutter build apk --debug --no-pub
- uses: actions/upload-artifact@v4
with:
name: finamp-android-debug.apk
path: build/app/outputs/flutter-apk/app-debug.apk
compression-level: 0 # no compression
- run: flutter build appbundle --debug --no-pub
build-ios:
name: Build for iOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
- run: flutter doctor
- run: flutter pub get
- run: flutter build ios --release --no-pub --no-codesign
build-linux:
name: Build for Linux
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build libgtk-3-dev
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter doctor
- run: flutter pub get
- run: flutter build linux --release --no-pub
# copy icon assets and desktop file next to bundle location for easy including in tar archive
- run: |
cp -r assets/icon/linux/ build/linux/x64/release/icons \
&& cp assets/finamp.desktop.m4 build/linux/x64/release/ \
&& cp assets/com.unicornsonlsd.finamp.metainfo.xml build/linux/x64/release/
# archive bundle and generate checksum
- run: |
tar -czf finamp-linux-release.tar.gz --directory build/linux/x64/release/ bundle icons finamp.desktop.m4 com.unicornsonlsd.finamp.metainfo.xml \
&& sha256sum finamp-linux-release.tar.gz > finamp-linux-release.tar.gz.sha256sum
- uses: actions/upload-artifact@v4
with:
name: finamp-linux-release.tar.gz
path: finamp-linux-release.tar.gz
compression-level: 0 # no compression
- uses: actions/upload-artifact@v4
with:
name: finamp-linux-release.tar.gz.sha256sum
path: finamp-linux-release.tar.gz.sha256sum
compression-level: 0 # no compression
build-windows:
name: Build for Windows
runs-on: windows-latest
steps:
- name: Support longpaths
run: git config --system core.longpaths true
- name: Clone repository
uses: actions/checkout@v4
# - uses: actions/setup-java@v2
# with:
# distribution: 'zulu'
# java-version: '17'
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter doctor
- run: flutter pub get
- run: flutter build windows
# TODO pack in redistributables?
- uses: actions/upload-artifact@v4
with:
name: finamp-windows
path: build/windows/x64/runner/Release/
- run: dart run msix:create --install-certificate false
#TODO would be nice to have an old-school installer here that can take the .exe + libraries and install them to the device + create a shortcut
- uses: actions/upload-artifact@v4
with:
name: finamp-windows.msix
path: build/windows/x64/runner/Release/finamp.msix
compression-level: 0 # no compression
# build-macos:
# name: Build for macOS
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Flutter
# uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# architecture: x64
# - run: flutter doctor
# - run: flutter pub get
# - run: flutter build macos --release --no-pub