-
Notifications
You must be signed in to change notification settings - Fork 2
163 lines (156 loc) · 5.01 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
name: build
on: [push, pull_request]
jobs:
linux:
strategy:
matrix:
target: [linux-arm64, linux-armhf, linux-riscv64, linux-x86_64]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: distrho/dpf-cmake-action@v1
with:
dpf_path: ./modules/dpf
lto: true
pawpaw: true
target: ${{ matrix.target }}
macos:
env:
WELCOME_TXT: ${{ github.workspace }}/utils/macos-installer-welcome.txt
strategy:
matrix:
target: [macos-universal-10.15]
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: distrho/dpf-cmake-action@v1
with:
dpf_path: ./modules/dpf
lto: true
pawpaw: true
target: ${{ matrix.target }}
windows:
strategy:
matrix:
target: [win64]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: distrho/dpf-cmake-action@v1
with:
dpf_path: ./modules/dpf
lto: false
pawpaw: true
target: ${{ matrix.target }}
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_BASENAME }}-installer
path: |
*-installer.exe
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
draft: false
prerelease: false
files: |
*-installer.exe
wasm:
strategy:
matrix:
target: [standalone, mod]
runs-on: ubuntu-22.04
env:
EMSCRIPTEN_VERSION: 3.1.27
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up cache
id: cache
uses: actions/cache@v3
with:
path: |
~/emsdk
key: emsdk-v1
- name: Set up dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -yqq brotli
mkdir bin
[ -d ~/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
cd ~/emsdk && ./emsdk install ${{ env.EMSCRIPTEN_VERSION }} && ./emsdk activate ${{ env.EMSCRIPTEN_VERSION }}
- name: Build simd-optimized
env:
AR: emar
CC: emcc
CXX: em++
NM: emnm
RANLIB: emranlib
STRIP: emstrip
PKG_CONFIG: false
CFLAGS: -O3 -ffast-math -fdata-sections -ffunction-sections -fno-strict-aliasing -flto -msse -msse2 -msse3 -msimd128
CXXFLAGS: -O3 -ffast-math -fdata-sections -ffunction-sections -fno-strict-aliasing -flto -msse -msse2 -msse3 -msimd128 -DPUGL_WASM_NO_KEYBOARD_INPUT -DPUGL_WASM_NO_MOUSEWHEEL_INPUT
LDFLAGS: -O3 -fdata-sections -ffunction-sections -fno-strict-aliasing -flto -Wl,--gc-sections -sAGGRESSIVE_VARIABLE_ELIMINATION=1 -Werror=lto-type-mismatch
run: |
source ~/emsdk/emsdk_env.sh
make -C src/standalone features
make -C src/standalone NOOPT=true MOD_BUILD=${{ matrix.target == 'mod' }} -j $(nproc)
mv build/bin/*.* bin/
- name: Cleanup
run: |
rm -rf build modules/dpf/build
- name: Build non-optimized
env:
AR: emar
CC: emcc
CXX: em++
NM: emnm
RANLIB: emranlib
STRIP: emstrip
PKG_CONFIG: false
CFLAGS: -O3 -ffast-math -fdata-sections -ffunction-sections -fno-strict-aliasing -flto
CXXFLAGS: -O3 -ffast-math -fdata-sections -ffunction-sections -fno-strict-aliasing -flto -DPUGL_WASM_NO_KEYBOARD_INPUT -DPUGL_WASM_NO_MOUSEWHEEL_INPUT
LDFLAGS: -O3 -fdata-sections -ffunction-sections -fno-strict-aliasing -flto -Wl,--gc-sections -sAGGRESSIVE_VARIABLE_ELIMINATION=1 -Werror=lto-type-mismatch
run: |
source ~/emsdk/emsdk_env.sh
make -C src/standalone features
make -C src/standalone NOOPT=true NOSIMD=true MOD_BUILD=${{ matrix.target == 'mod' }} -j $(nproc)
mv build/bin/*.* bin/
- name: Pack binaries
run: |
cd bin
brotli -k -q 11 *.*
zip -r -9 ../${{ github.event.repository.name }}-wasm-${{ matrix.target }}.zip $(ls *.*)
- uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-wasm-${{ matrix.target }}
path: |
*.zip
pluginval:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: distrho/dpf-cmake-action@v1
with:
dpf_path: ./modules/dpf
target: pluginval
source:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: distrho/dpf-cmake-action@v1
with:
dpf_path: ./modules/dpf
target: source