forked from system64MC/smf-dsp
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (148 loc) · 4.94 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
name: build
on: push
env:
BUILD_TYPE: Release
jobs:
build_for_linux:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install \
libsdl2-dev \
libsdl2-image-dev \
libuv1-dev \
libjack-jackd2-dev \
libpulse-dev \
libasound2-dev \
libfluidsynth-dev \
libapr1-dev \
libaprutil1-dev
- name: Set up AppImage tools
run: |
mkdir -p download/
getfile() {
local url="$1"
local base="$2"
test -z "$base" && base="$(basename "$1")"
test -f download/"$base" || wget -O download/"$base" "$url"
}
getfile https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
getfile https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
sudo install -m 755 download/appimagetool-x86_64.AppImage /usr/bin/appimagetool
sudo install -m 755 download/linuxdeploy-x86_64.AppImage /usr/bin/linuxdeploy
- name: Create Build Environment
shell: bash
working-directory: ${{runner.workspace}}
run: cmake -E make_directory build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake "$GITHUB_WORKSPACE" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=/usr
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config "$BUILD_TYPE" -j 2
- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
run: DESTDIR="$(pwd)/target" cmake --build . --target install -j 2
- name: Create AppImage
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
linuxdeploy --appdir="$(pwd)/target"
appimagetool "$(pwd)/target"
mkdir -p release/
mv -f *.AppImage release/
- uses: actions/upload-artifact@v2
with:
name: SMF-DSP 64-bit for GNU Linux
path: ${{runner.workspace}}/build/release/*.AppImage
build_for_mingw32:
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: mingw32
update: true
install: >-
base-devel
git
mingw-w64-i686-cmake
mingw-w64-i686-pkg-config
mingw-w64-i686-gcc
mingw-w64-i686-winpthreads
mingw-w64-i686-pkg-config
mingw-w64-i686-libiconv
mingw-w64-i686-icu
mingw-w64-i686-libuv
mingw-w64-i686-SDL2
mingw-w64-i686-SDL2_image
mingw-w64-i686-llvm
- uses: actions/checkout@v2
with:
repository: jpcima/dll-bundler
submodules: recursive
path: dll-bundler
- name: Install dll-bundler
run: |
mkdir dll-bundler-build
cd dll-bundler-build
cmake "$GITHUB_WORKSPACE/dll-bundler" -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=/mingw32
cmake --build . -j 2
cmake --build . -j --target install
cd ..
- uses: actions/checkout@v2
with:
repository: andrewrk/libsoundio
submodules: recursive
ref: 2.0.0
path: libsoundio
- name: Install libsoundio
run: |
mkdir libsoundio-build
cd libsoundio-build
cmake "$GITHUB_WORKSPACE/libsoundio" -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=/mingw32 -DBUILD_EXAMPLE_PROGRAMS=OFF -DBUILD_TESTS=OFF
cmake --build . -j 2
cmake --build . -j --target install
# fix installation
mv /mingw32/{lib,bin}/libsoundio.dll
cd ..
- name: Set build name
run: |
echo "build_name=smf-dsp-win32" >> "$GITHUB_ENV"
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Create Build Environment
working-directory: ${{runner.workspace}}
run: cmake -E make_directory build
- name: Configure CMake
working-directory: ${{runner.workspace}}/build
run: cmake -G "MSYS Makefiles" "$GITHUB_WORKSPACE" -DCMAKE_BUILD_TYPE="$BUILD_TYPE"
- name: Build
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config "$BUILD_TYPE" -j 2
- name: Bundle DLL
working-directory: ${{runner.workspace}}/build
run: |
for f in *.exe *.dll; do
dll-bundler -L "$(cygpath -m /mingw32/bin)" "$f"
done
- name: Install
working-directory: ${{runner.workspace}}/build
run: |
mkdir -p release/"${build_name}"/
for f in *.{exe,dll}; do cp -f "$f" release/"${build_name}"/; done
- uses: actions/upload-artifact@v2
with:
name: SMF-DSP 32-bit for Windows
path: ${{runner.workspace}}/build/release/