Skip to content

Separate content switching code to func for future #489

Separate content switching code to func for future

Separate content switching code to func for future #489

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/