yquake2remaster/.github/workflows/windows.yml
2024-06-22 17:35:25 +03:00

128 lines
4.7 KiB
YAML

name: Build windows application
run-name: windows
on:
push:
tags:
- "*"
jobs:
build64:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw64, env: x86_64 }
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
git
make
zip
unzip
mingw-w64-${{matrix.env}}-curl
mingw-w64-${{matrix.env}}-ffmpeg
mingw-w64-${{matrix.env}}-gcc
mingw-w64-${{matrix.env}}-make
mingw-w64-${{matrix.env}}-openal
mingw-w64-${{matrix.env}}-SDL2
mingw-w64-${{matrix.env}}-vulkan-headers
mingw-w64-${{matrix.env}}-wget
- name: Check out repository code
uses: actions/checkout@v4
- name: Build Release code
shell: msys2 {0}
run: |
make
- name: Create release package
shell: msys2 {0}
run: |
# copy docs
cp -rv stuff/mapfixes/* LICENSE README.md doc release/
# static ffmpeg
wget -c https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2023-11-30-12-55/ffmpeg-n6.0.1-win64-lgpl-shared-6.0.zip
unzip -o ffmpeg-n6.0.1-win64-lgpl-shared-6.0.zip
cp ffmpeg-n6.0.1-win64-lgpl-shared-6.0/bin/*.dll release/
# remove unused libraries
rm -fv release/avdevice*.dll release/avfilter*.dll release/postproc*.dll
# static SDL2
wget -c https://github.com/libsdl-org/SDL/releases/download/release-2.30.1/SDL2-2.30.1-win32-x64.zip
unzip -o SDL2-2.30.1-win32-x64.zip
cp SDL2.dll release/
# static openal
wget -c https://www.openal-soft.org/openal-binaries/openal-soft-1.23.1-bin.zip
unzip -o openal-soft-1.23.1-bin.zip
cp openal-soft-1.23.1-bin/bin/Win64/soft_oal.dll release/OpenAL32.dll
# static curl
wget -c https://curl.se/windows/dl-8.5.0_3/curl-8.5.0_3-win64-mingw.zip
unzip -o curl-8.5.0_3-win64-mingw.zip
cp curl-8.5.0_3-win64-mingw/bin/libcurl-x64.dll release/curl.dll
# create archive
mkdir yquake2remaster-${{matrix.env}}-${{github.ref_name}}
cp -rv release/* yquake2remaster-${{matrix.env}}-${{github.ref_name}}
zip -9r yquake2remaster-${{matrix.env}}-${{github.ref_name}}.zip yquake2remaster-${{matrix.env}}-${{github.ref_name}}
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: |
yquake2remaster-${{matrix.env}}-${{github.ref_name}}.zip
build32:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw32, env: i686 }
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
git
make
zip
unzip
mingw-w64-${{matrix.env}}-curl
mingw-w64-${{matrix.env}}-ffmpeg
mingw-w64-${{matrix.env}}-gcc
mingw-w64-${{matrix.env}}-make
mingw-w64-${{matrix.env}}-openal
mingw-w64-${{matrix.env}}-SDL2
mingw-w64-${{matrix.env}}-vulkan-headers
mingw-w64-${{matrix.env}}-wget
- name: Check out repository code
uses: actions/checkout@v4
- name: Build Release code
shell: msys2 {0}
run: |
sed -i 's|WITH_AVCODEC:=yes|WITH_AVCODEC:=no|g' Makefile
make
- name: Create release package
shell: msys2 {0}
run: |
# copy docs
cp -rv stuff/mapfixes/* LICENSE README.md doc release/
# static SDL2
wget -c https://github.com/libsdl-org/SDL/releases/download/release-2.30.1/SDL2-2.30.1-win32-x86.zip
unzip -o SDL2-2.30.1-win32-x86.zip
cp SDL2.dll release/
# static openal
wget -c https://www.openal-soft.org/openal-binaries/openal-soft-1.23.1-bin.zip
unzip -o openal-soft-1.23.1-bin.zip
cp openal-soft-1.23.1-bin/bin/Win32/soft_oal.dll release/OpenAL32.dll
# static curl
wget -c https://curl.se/windows/dl-8.5.0_3/curl-8.5.0_3-win32-mingw.zip
unzip -o curl-8.5.0_3-win32-mingw.zip
cp curl-8.5.0_3-win32-mingw/bin/libcurl.dll release/curl.dll
# create archive
mkdir yquake2remaster-${{matrix.env}}-${{github.ref_name}}
cp -rv release/* yquake2remaster-${{matrix.env}}-${{github.ref_name}}
zip -9r yquake2remaster-${{matrix.env}}-${{github.ref_name}}.zip yquake2remaster-${{matrix.env}}-${{github.ref_name}}
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: |
yquake2remaster-${{matrix.env}}-${{github.ref_name}}.zip