forked from supercollider/supercollider
-
Notifications
You must be signed in to change notification settings - Fork 0
199 lines (176 loc) · 8.16 KB
/
build_windows.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
name: Build Windows
on:
workflow_call:
inputs:
sc-version:
required: true
type: string
jobs:
build-windows:
runs-on: windows-${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
include:
- job-name: "32-bit"
fftw-arch: "x86"
cmake-arch: "Win32"
os-version: "2019"
qt-version: "5.15.2"
qt-arch: "win32_msvc2019"
fftw-url: "ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll32.zip"
cmake-generator: "Visual Studio 16 2019"
vcvars-script-path: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars32.bat"
vcpkg-triplet: x86-windows-release
use-qtwebengine: "ON" # might need to be turned off for MinGW
qt-modules: "qtwebengine"
# artifact-suffix: "win32" # set if needed - will trigger artifact upload
# create-installer: ${{ startsWith(github.ref, 'refs/tags/') }}
# installer-suffix: "win32-installer"
- job-name: "64-bit MSVC 2022"
fftw-arch: "x64"
cmake-arch: "x64"
os-version: "2022"
qt-version: "6.7.3"
qt-arch: "win64_msvc2019_64"
fftw-url: "ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip"
cmake-generator: "Visual Studio 17 2022"
vcvars-script-path: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
vcpkg-triplet: x64-windows-release
use-qtwebengine: "ON" # might need to be turned off for MinGW
qt-modules: 'qtwebengine qtwebchannel qtwebsockets qtpositioning'
artifact-suffix: "win64" # set if needed - will trigger artifact upload
create-installer: ${{ startsWith(github.ref, 'refs/tags/') }}
installer-suffix: "win64-installer"
- job-name: "64-bit MSVC 2019"
fftw-arch: "x64"
cmake-arch: "x64"
os-version: "2019"
qt-version: "6.7.3"
qt-arch: "win64_msvc2019_64"
fftw-url: "ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip"
cmake-generator: "Visual Studio 16 2019"
vcvars-script-path: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
vcpkg-triplet: x64-windows-release
use-qtwebengine: "ON" # might need to be turned off for MinGW
qt-modules: 'qtwebengine qtwebchannel qtwebsockets qtpositioning'
- job-name: "64-bit MinGW"
fftw-arch: "x64"
os-version: "2022"
qt-version: "6.7.0"
qt-arch: "win64_mingw"
fftw-url: "ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip"
cmake-generator: "MinGW Makefiles"
chocolatey-options: "" # '--forcex86' for 32-bit build
use-qtwebengine: "OFF" # might need to be turned off for MinGW
qt-modules: "qtpositioning"
artifact-suffix: "win64-mingw" # set if needed - will trigger artifact upload
name: Windows ${{ matrix.job-name }}
env:
BUILD_PATH: ${{ github.workspace }}/build
INSTALL_PATH: ${{ github.workspace }}/build/Install
LIBS_DOWNLOAD_PATH: ${{ github.workspace }}/../3rd-party
FFTW_INSTALL_DIR: "C:/Program Files/fftw"
ARTIFACT_FILE: "SuperCollider-${{ inputs.sc-version }}-${{ matrix.artifact-suffix }}"
INSTALLER_FILE: "SuperCollider-${{ inputs.sc-version }}-${{ matrix.installer-suffix }}"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: prepare timestamp for cache
id: current-date
shell: bash
run: echo "stamp=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: cache vcpkg
if: matrix.vcpkg-triplet
uses: actions/cache@v4
with:
path: ~/AppData/Local/vcpkg/archives
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.vcpkg-triplet }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.vcpkg-triplet }}-
- name: cache ccache
uses: actions/cache@v4
with:
path: ~/AppData/Local/ccache # updated in ccache 4.7, see https://github.com/ccache/ccache/issues/1023
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.qt-arch }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.qt-arch }}-
- name: install qt using aqtinstall
uses: jurplel/install-qt-action@v3
with:
modules: ${{ matrix.qt-modules }}
version: ${{ matrix.qt-version }}
arch: ${{ matrix.qt-arch }}
cache: true
cache-key-prefix: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.qt-version }}-qt${{ matrix.qt-arch }}-${{ matrix.qt-modules }}
- name: install ccache
shell: bash
run: |
choco install ccache --no-progress
echo "`echo c:/ProgramData/chocolatey/lib/ccache/tools/ccache*`" >> $GITHUB_PATH # put the direct path before the path of the choco's "shim" (link subsitute)
- name: install libsndfile
shell: bash
run: |
if [[ -n "${{ matrix.vcpkg-triplet }}" ]]; then
vcpkg install libsndfile --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
else
choco install libsndfile --no-progress ${{ matrix.chocolatey-options }}
fi
- name: download fftw
shell: bash
run: |
mkdir -p "$FFTW_INSTALL_DIR" && cd "$FFTW_INSTALL_DIR"
curl -L ${{ matrix.fftw-url }} -o fftw.zip
7z x fftw.zip -y
- name: create fftw msvc library
if: matrix.vcvars-script-path
shell: cmd
working-directory: ${{ env.FFTW_INSTALL_DIR }}
run: |
call "${{ matrix.vcvars-script-path }}"
lib.exe /machine:${{ matrix.fftw-arch }} /def:libfftw3f-3.def
- name: install asio sdk
shell: bash
env:
ASIO_PATH: ${{ env.LIBS_DOWNLOAD_PATH }}/asio_sdk
run: |
mkdir -p $ASIO_PATH && cd $ASIO_PATH
curl -L https://www.steinberg.net/asiosdk -o asio.zip
7z x asio.zip -y
mv asiosdk_* $GITHUB_WORKSPACE/external_libraries/portaudio/asiosdk
- name: install readline
if: matrix.vcpkg-triplet
shell: bash
run: |
vcpkg install readline --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
- name: configure
shell: bash
run: |
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
mkdir $BUILD_PATH && cd $BUILD_PATH
cmake -G "${{ matrix.cmake-generator }}" -A "${{ matrix.cmake-arch }}" -D SUPERNOVA=ON -D SC_USE_QTWEBENGINE=${{ matrix.use-qtwebengine }} -D CMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET="${{ matrix.vcpkg-triplet }}" .. # build type is specified here for MinGW build and for vcpkg
- name: build
shell: bash
run: |
cmake --build $BUILD_PATH --config Release --target install --parallel 2
- name: create archive
if: matrix.artifact-suffix
shell: bash
run: cd $INSTALL_PATH && 7z a $ARTIFACT_FILE.zip -tzip SuperCollider # this assumes that we end up with the build in the folder SuperCollider
- name: upload artifacts
uses: actions/upload-artifact@v4
if: matrix.artifact-suffix
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip
- name: create installer
if: matrix.create-installer == true
shell: bash
run: |
export PATH="C:\Program Files (x86)\NSIS":$PATH
cmake --build $BUILD_PATH --config Release --target installer
- name: upload installer
uses: actions/upload-artifact@v4
if: matrix.create-installer == true
with:
name: ${{ env.INSTALLER_FILE }}
path: ${{ env.INSTALL_PATH }}/*.exe