forked from woodenshark/Lightpack
-
Notifications
You must be signed in to change notification settings - Fork 189
249 lines (244 loc) · 8.24 KB
/
ci.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '43 17 * * FRI'
defaults:
run:
working-directory: ./Software
jobs:
build-pacman:
runs-on: ubuntu-20.04
name: pacman Build (Arch Linux)
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Build
working-directory: Software/dist_linux
run: ./build-in-docker.sh pacman archlinux latest
- name: Check Package
run: |
set -xe
PKG_PATH=$(ls dist_linux/pacman/prismatik*.pkg.tar*)
echo "PKG_PATH=Software/$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$(basename $PKG_PATH)" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}
build-flatpack:
runs-on: ubuntu-20.04
name: Flatpack Build
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Install Flatpak
run: |
set -xe
sudo apt update
sudo apt install flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- name: Build
working-directory: Software/dist_linux
run: ./build-natively.sh flatpak
- name: Check Package
run: |
set -xe
PKG_PATH=$(ls dist_linux/flatpak/prismatik*.flatpak)
echo "PKG_PATH=Software/$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$(basename $PKG_PATH)" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}
build-dpkg:
runs-on: ubuntu-20.04
strategy:
matrix:
os: [ 'ubuntu 22.04', 'ubuntu 20.04', 'ubuntu 18.04', 'debian 11.5' ]
name: dpkg Build (${{ matrix.os }})
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Build
working-directory: Software/dist_linux
run: ./build-in-docker.sh dpkg ${{ matrix.os }}
- name: Check Package
run: |
set -xe
PKG_PATH=$(ls dist_linux/dpkg/prismatik*.deb)
echo "PKG_PATH=Software/$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$(basename $PKG_PATH | sed 's#amd64#${{ matrix.os }}_amd64#; s# ##')" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}
build-fw:
name: Firmware Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- run: sudo apt-get install gcc-avr avr-libc build-essential
- run: ./build_batch.sh
working-directory: ./Firmware
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: firmware
path: Firmware/hex/*
build-win:
name: Windows Build
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- run: choco install --no-progress openssl
- uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
dir: C:\Qt
version: 6.*
modules: qtserialport
- name: Cached Bass
id: cache-bass
uses: actions/cache@v2
with:
path: C:\bass
key: ${{ runner.os }}-bass_24
- name: Install Bass
if: steps.cache-bass.outputs.cache-hit != 'true'
shell: powershell
run: |
If (!(Test-Path -Path "C:\bass" )) {
(New-Object System.Net.WebClient).DownloadFile("https://un4seen.com/files/bass24.zip", "C:\bass.zip")
(New-Object System.Net.WebClient).DownloadFile("https://un4seen.com/files/basswasapi24.zip", "C:\basswasapi.zip")
Expand-Archive C:\bass.zip -DestinationPath C:\bass
Expand-Archive C:\basswasapi.zip -DestinationPath C:\bass\wasapi
}
- name: Cached NightLight
id: cache-nightlight
uses: actions/cache@v2
with:
path: C:\NightLight
key: ${{ runner.os }}-nightlight_1.3_1909
- name: Install NightLight
if: steps.cache-nightlight.outputs.cache-hit != 'true'
shell: powershell
run: |
If (!(Test-Path -Path "C:\NightLight" )) {
(New-Object System.Net.WebClient).DownloadFile("https://github.com/zomfg/NightLightLibrary/releases/download/v1.3/NightLightLibrary-x64-1.3-win1909preview.zip", "C:\NightLight.zip")
Expand-Archive C:\NightLight.zip -DestinationPath C:\NightLight
}
- name: Set build vars
shell: bash
run: |
echo "OPENSSL_DIR = \"C:\\Program Files\\OpenSSL\\bin\"" > build-vars.prf
echo "DEFINES += BASS_SOUND_SUPPORT" >> build-vars.prf
echo "BASS_DIR = \"C:\\bass\"" >> build-vars.prf
echo "BASSWASAPI_DIR = \"C:\\bass\\wasapi\"" >> build-vars.prf
echo "DEFINES += NIGHTLIGHT_SUPPORT" >> build-vars.prf
echo "NIGHTLIGHT_DIR = \"C:\\NightLight\"" >> build-vars.prf
echo "TARGET_ARCH = x86_64" >> build-vars.prf
- name: Build
shell: cmd
run: |
set QTDIR=%Qt6_Dir%
call scripts\win32\generate_sln.bat
MSBuild.exe Lightpack.sln /p:Configuration=Release
- name: Prepare Installer
shell: bash
run: |
scripts/win32/prepare_installer.sh
- name: Build Installer
shell: cmd
run: |
"C:/Program Files (x86)/Inno Setup 6/ISCC.exe" script_qt6.iss
working-directory: ./Software/dist_windows
- name: Check Package
shell: bash
run: |
set -xe
PKG_PATH=$(ls dist_windows/Output/Prismatik*.exe)
PKG_NAME=$(basename "$PKG_PATH")
echo "PKG_PATH=Software/$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}
build-macos:
name: macOS Build
runs-on: macOS-11
env:
QT_DEST: Qt
steps:
- uses: actions/checkout@v2
- name: Select Latest Xcode
run: |
set -xe
sw_vers
ls -d /Applications/Xcode*.app
LAST_XCODE=$(ls -d /Applications/Xcode*.app | grep -v beta | sort -Vr | head -n1)
sudo xcode-select --switch $LAST_XCODE
xcode-select -p
xcodebuild -version
xcodebuild -showsdks
- name: install Qt installer
run: |
set -xe
pip3 install -U pip
pip3 install aqtinstall
pip3 show aqtinstall
aqt list-qt mac desktop
QT_VERSION=$(aqt list-qt mac desktop --spec 6.2 --latest-version)
echo "QT_VERSION=$QT_VERSION" >> $GITHUB_ENV
- name: Cached Qt
id: cache-qt
uses: actions/cache@v2
with:
path: ${{ env.QT_DEST }}
key: ${{ runner.os }}-qt-${{ env.QT_VERSION }}
- name: install Qt
# The cache is relative to the workspace (not the default working dir)
# so the QT installation should be too.
working-directory: ./
run: |
set -xe
QTDIR=$PWD/$QT_DEST/$QT_VERSION/macos
echo "QTDIR=$QTDIR" >> $GITHUB_ENV
if [[ -d "$QTDIR" ]]
then
echo using cached version
else
echo installing fresh version
aqt install-qt mac desktop $QT_VERSION clang_64 --modules qtserialport --outputdir $QT_DEST
fi
- name: Build
run: |
export PATH=$QTDIR/bin:$PATH
qmake -r
make
macdeployqt bin/Prismatik.app -dmg
- name: Check Package
run: |
set -xe
VERSION=`cat RELEASE_VERSION`
PKG_PATH="Software/bin/Prismatik.dmg"
PKG_NAME="Prismatik_${VERSION}.dmg"
echo "PKG_PATH=$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_PATH }}