forked from KD-lab-Open-Source/Perimeter
-
Notifications
You must be signed in to change notification settings - Fork 1
134 lines (131 loc) · 4.57 KB
/
windows_msys_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
name: Windows MSYS Build
on:
push:
pull_request:
env:
GH_CACHE_KEY: 8
jobs:
build:
strategy:
fail-fast: false
matrix:
env: [
{sys: mingw64, build_type: Debug, arch: x86_64, arch_zip: x64},
{sys: mingw32, build_type: Release, arch: i686, arch_zip: x86},
{sys: mingw64, build_type: Release, arch: x86_64, arch_zip: x64},
]
name: ${{matrix.env.build_type}} ${{matrix.env.sys}}
defaults:
run:
shell: msys2 {0}
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: "${{matrix.env.sys}}"
install:
base-devel
wget
unzip
git
bash
mingw-w64-cross-winpthreads
pacboy:
ninja:p
gcc:p
cmake:p
make:p
SDL2:p
SDL2_image:p
SDL2_net:p
SDL2_mixer:p
boost:p
lld:p
libbacktrace:p
libvpx:p
nasm:p
yasm:p
zlib:p
- uses: actions/cache@v3
id: cache
with:
path: |
${{ github.workspace }}\downloads
${{ github.workspace }}\ffmpeg
key: MSYS-${{matrix.env.arch}}-${{ env.GH_CACHE_KEY }}
- name: SDL2 binaries -- download
if: steps.cache.outputs.cache-hit != 'true' && matrix.env.arch_zip != ''
run: |
mkdir downloads
wget https://github.com/libsdl-org/SDL_image/releases/download/release-2.6.3/SDL2_image-2.6.3-win32-${{matrix.env.arch_zip}}.zip -O downloads/SDL2_image.zip
wget https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.6.3/SDL2_mixer-2.6.3-win32-${{matrix.env.arch_zip}}.zip -O downloads/SDL2_mixer.zip
unzip downloads/SDL2_image.zip -d downloads/SDL2_image
unzip downloads/SDL2_mixer.zip -d downloads/SDL2_mixer
- name: ffmpeg -- download
if: steps.cache.outputs.cache-hit != 'true'
run: git clone --depth 1 --branch n5.1 https://git.ffmpeg.org/ffmpeg.git ffmpeg
- name: ffmpeg -- configure
if: steps.cache.outputs.cache-hit != 'true'
run: |
./configure \
--prefix=/${{matrix.env.sys}} \
--enable-static --disable-shared \
--disable-everything \
--enable-swscale \
--enable-swresample \
--enable-zlib \
--enable-libvpx \
--enable-libvorbis \
--enable-demuxer=avi,rawvideo,bink,matroska \
--enable-decoder=png,rawvideo,bink,binkaudio_dct,vorbis,opus,vp8,vp9 \
--enable-parser=png,vp9 \
--enable-filter=aresample,aformat \
--enable-protocol=file \
--disable-d3d11va \
--disable-dxva2 \
--disable-vulkan \
--disable-network \
--disable-doc --disable-ffplay --disable-ffprobe --disable-ffmpeg \
--disable-bzlib --disable-libopenjpeg --disable-iconv
working-directory: ffmpeg
- name: ffmpeg -- build
if: steps.cache.outputs.cache-hit != 'true'
run: |
mingw32-make -j4
working-directory: ffmpeg
- name: ffmpeg -- install
run: |
mingw32-make install
working-directory: ffmpeg
- name: perimeter -- create build dir
run: mkdir build
- name: perimeter -- configure build
run: cmake -G Ninja
-S .. -B .
-DCMAKE_BUILD_TYPE=${{matrix.env.build_type}}
-DOPTION_LINKER=lld
-DOPTION_LINK_LIBS="bcrypt;winpthread.a"
working-directory: build
- name: perimeter -- make
run: ninja
working-directory: build
- name: perimeter -- prepare artifact folder
run: |
mkdir -p perimeter/bin
cp /${{matrix.env.sys}}/bin/SDL2.dll perimeter/bin/
cp /${{matrix.env.sys}}/bin/SDL2_net.dll perimeter/bin/
if [[ -n "${{matrix.env.arch_zip}}" ]]; then
cp downloads/SDL2_image/*.dll perimeter/bin/
cp downloads/SDL2_mixer/*.dll perimeter/bin/
else
cp /${{matrix.env.sys}}/bin/SDL2_image.dll perimeter/bin/
cp /${{matrix.env.sys}}/bin/SDL2_mixer.dll perimeter/bin/
fi
cp build/Source/perimeter.exe perimeter/bin/
- name: perimeter -- strip binary
run: strip -g -x perimeter/bin/perimeter.exe
- uses: actions/upload-artifact@v1
with:
name: Perimeter MSYS ${{matrix.env.build_type}} ${{matrix.env.sys}}
path: perimeter/bin/