-
-
Notifications
You must be signed in to change notification settings - Fork 7
254 lines (213 loc) · 9.79 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
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
250
251
252
253
254
on: [push]
env:
ProjectName: BenTo
PackagesVersion: 1.2.10
jobs:
windows:
name: Windows
#if: false # always skip job (heap space needs fix)
runs-on: windows-2019
strategy:
matrix:
include:
- arch: win-x64
buildFolder: "VisualStudio2019_CI"
installerName: install
fail-fast: false
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Checkout JUCE
uses: actions/checkout@v2
with:
repository: benkuper/JUCE
ref: develop-local
path: JUCE
- name: Set Variables
id: set_variables
uses: ./.github/actions/set-suffix
with:
os: ${{ matrix.arch }}
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Force 64-bit Linker
shell: powershell
run: |
cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
Get-Content "$env:temp\vcvars.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] }}
- name: Build
run: msbuild "Builds/${{ matrix.buildFolder }}/${{ env.ProjectName }}.sln" /p:PreferredToolArchitecture=x64 /m /verbosity:normal /p:Configuration=${{ steps.set_variables.outputs.config }}
- name: Create Package
id: create_package
shell: powershell
run: |
Set-Variable -Name "PKGNAME" -Value "${{ env.ProjectName }}-${{ steps.set_variables.outputs.suffix }}"
Invoke-WebRequest "${{ secrets.DEPDIRURL }}${{ env.ProjectName }}-win-x64-${{ steps.set_variables.outputs.dep }}-dependencies.zip" -OutFile ./deps.zip
7z e deps.zip -aoa
&"C:/Program Files (x86)/Inno Setup 6/ISCC.exe" "${{ github.workspace }}/${{ matrix.installerName }}.iss" /O. /F$PKGNAME
echo "::set-output name=pkg-name::$PKGNAME.exe"
echo "::set-output name=pdb-name::$PKGNAME.pdb"
working-directory: ./Binaries/CI/App
- name: Upload
uses: ./.github/actions/upload
with:
pkg-name: ./Binaries/CI/App/${{ steps.create_package.outputs.pkg-name }}
url: ${{ secrets.UPLOADURL }}
pass: ${{ secrets.UPLOADPASS }}
- name: Rename PDB
if: ${{ steps.set_variables.outputs.config == 'Release' && matrix.arch == 'win-x64' }}
id: rename_pdb
shell: powershell
run: |
Rename-Item -Path "./${{ env.ProjectName }}.pdb" -NewName "${{ steps.create_package.outputs.pdb-name }}"
working-directory: ./Builds/${{ matrix.buildFolder }}/x64/${{ steps.set_variables.outputs.config }}/App
- name: Upload PDB
if: false #force no upload for Bento right now
#if: ${{ steps.set_variables.outputs.config == 'Release' && matrix.arch == 'win-x64' }}
uses: ./.github/actions/upload
with:
pkg-name: ./Builds/${{ matrix.buildFolder }}/x64/${{ steps.set_variables.outputs.config }}/App/${{ steps.create_package.outputs.pdb-name }}
url: ${{ secrets.PDBUPLOADURL }}
pass: ${{ secrets.UPLOADPASS }}
osx:
#if: false # tmp disable
name: OSX
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Checkout JUCE
uses: actions/checkout@v2
with:
repository: benkuper/JUCE
ref: develop-local
path: JUCE
- name: Set Suffix
id: set_variables
uses: ./.github/actions/set-suffix
with:
os: 'osx'
- name: Download Packages
run: |
curl -L -o Packages.dmg 'http://s.sudre.free.fr/Software/files/Packages.dmg'
hdiutil mount Packages.dmg
sudo installer -pkg "/Volumes/Packages ${{ env.PackagesVersion }}/Install Packages.pkg" -target /
hdiutil detach "/Volumes/Packages ${{ env.PackagesVersion }}/"
- name: Build
uses: sersoft-gmbh/[email protected]
with:
project: Builds/MacOSX_CI/${{ env.ProjectName }}.xcodeproj
destination: platform=macOS
jobs: 2
action: build
configuration: Release
use-xcpretty: true
- name: Create Package
id: create_package
run: |
packagesbuild ${{ env.ProjectName }}.pkgproj
PKGNAME=${{ env.ProjectName }}-${{ steps.set_variables.outputs.suffix }}.pkg
mv ${{ env.ProjectName }}.pkg $PKGNAME
echo "::set-output name=pkg-name::$PKGNAME"
working-directory: ./Package
- name: Upload
uses: ./.github/actions/upload
with:
pkg-name: ./Package/${{ steps.create_package.outputs.pkg-name }}
url: ${{ secrets.UPLOADURL }}
pass: ${{ secrets.UPLOADPASS }}
linux:
#if: false # tmp disable
name: Linux
runs-on: ubuntu-18.04
strategy:
matrix:
include:
- arch: linux-x64
buildFolder: "LinuxMakefile"
- arch: linux-armhf
buildFolder: "Raspberry"
fail-fast: false
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Checkout JUCE
uses: actions/checkout@v2
with:
repository: benkuper/JUCE
ref: develop-local
path: JUCE
- name: Set Suffix
id: set_variables
uses: ./.github/actions/set-suffix
with:
os: ${{ matrix.arch }}
- name: Installing dependencies
id: install_deps
#shell: bash {0} # Opt out of fail-fast behavior (necessary to ignore fetch errors)
run: |
echo "Target system architecture: ${{ matrix.arch }}"
if [ "${{ matrix.arch }}" == "linux-armhf" ];
then
sudo tee /etc/apt/sources.list << END
deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb [arch=amd64] http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
END
sudo dpkg --add-architecture armhf
sudo apt-get update
echo "Installing armhf cross compilation tools"
sudo apt-get install -qy g++-arm-linux-gnueabihf
echo "Installing extra lib dependencies"
sudo apt-get install -qyf libgdk-pixbuf2.0-dev:armhf libpango1.0-dev:armhf libsoup2.4-dev:armhf libharfbuzz-dev:armhf libxml2-dev:armhf libicu-dev:armhf libc6-dev:armhf libxft-dev:armhf
echo "Downloading AppImage runtime for armhf"
cd ${{ github.workspace }}
wget "https://github.com/AppImage/AppImageKit/releases/download/12/runtime-armhf"
echo "::set-output name=appImageRuntime::--runtime-file ${{ github.workspace }}/runtime-armhf"
# DEP_ARCH is used later when downloading the dependencies
DEP_ARCH="armhf"
fi
sudo apt-get update
echo "Installing JUCE lib dependencies and extra tools"
sudo apt-get install -qyf libfreetype6-dev:$DEP_ARCH libx11-dev:$DEP_ARCH libxinerama-dev:$DEP_ARCH libxrandr-dev:$DEP_ARCH libxcursor-dev:$DEP_ARCH libxcomposite-dev:$DEP_ARCH mesa-common-dev:$DEP_ARCH libasound2-dev:$DEP_ARCH freeglut3-dev:$DEP_ARCH libcurl4-gnutls-dev:$DEP_ARCH libasound2-dev:$DEP_ARCH libjack-dev:$DEP_ARCH libbluetooth-dev:$DEP_ARCH libgtk-3-dev:$DEP_ARCH libwebkit2gtk-4.0-dev:$DEP_ARCH libsdl2-dev:$DEP_ARCH libfuse2:$DEP_ARCH libusb-1.0-0-dev:$DEP_ARCH libhidapi-dev:$DEP_ARCH
sudo apt-get install -qy curl
cd ${{ github.workspace }}
wget "https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
- name: Build
run: |
if [ "${{ matrix.arch }}" == "linux-armhf" ];
then
export CXX=arm-linux-gnueabihf-g++
export CC=arm-linux-gnueabihf-gcc
export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
export TARGET_ARCH="-march=armv8-a" # TARGET_ARCH is used in the Makefile
fi
cd ${{ github.workspace }}/Builds/${{ matrix.buildFolder }}
make -j2 CONFIG=Release
- name: Create AppImage
id: create_package
run: |
mkdir -p ${{ env.ProjectName }}.AppDir/usr/bin/
cp build/${{ env.ProjectName }} ${{ env.ProjectName }}.AppDir/usr/bin/
PKGNAME=${{ env.ProjectName }}-${{ steps.set_variables.outputs.suffix }}.AppImage
echo "::set-output name=pkg-name::$PKGNAME"
${{ github.workspace }}/appimagetool-x86_64.AppImage ${{ steps.install_deps.outputs.appImageRuntime }} ${{ env.ProjectName }}.AppDir $PKGNAME
working-directory: ./Builds/${{ matrix.buildFolder }}
- name: Upload
uses: ./.github/actions/upload
with:
pkg-name: ./Builds/${{ matrix.buildFolder }}/${{ steps.create_package.outputs.pkg-name }}
url: ${{ secrets.UPLOADURL }}
pass: ${{ secrets.UPLOADPASS }}