Add test githaub action builds

Testbuild is applied to macos, linux, win32, win64.

Win32/64 additionally create release for tags.

Linux build is checked with disabled ffmpeg flag as LTS linux image
has unsupported ffmpeg version.

Based on:
*  180050b9a3
This commit is contained in:
Denis Pauk 2024-08-11 18:08:40 +03:00
parent ab6ce60758
commit 5d082ab2d9
5 changed files with 314 additions and 146 deletions

61
.github/workflows/linux.yml vendored Normal file
View file

@ -0,0 +1,61 @@
name: Testbuild for Linux
run-name: testbuild_linux
on:
push:
branches:
- 'master'
pull_request:
types:
- opened
- edited
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_ubuntu_x64_64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- env: ubuntu
steps:
- name: Install build dependencies
run: |
sudo apt update
sudo apt install libgl1-mesa-dev libsdl2-dev libopenal-dev libcurl4-openssl-dev \
libavformat-dev libswscale-dev libvulkan-dev build-essential
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
run: |
sed -i 's|WITH_AVCODEC:=yes|WITH_AVCODEC:=no|g' Makefile
# Public runners come with 2 CPUs.
make -j2
- name: Create testbuild package
run: |
# Create release directory tree
mkdir -p publish/quake2-linux-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-linux-${{github.sha}}/
# Copy misc assets
cp -r stuff/yq2.cfg publish/quake2-linux-${{github.sha}}/misc/yq2.cfg
cp -r stuff/mapfixes publish/quake2-linux-${{github.sha}}/misc
cp LICENSE publish/quake2-linux-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-linux-${{github.sha}}/misc/docs/README.txt
cp doc/010_index.md publish/quake2-linux-${{github.sha}}/misc/docs/010_index.txt
cp doc/020_installation.md publish/quake2-linux-${{github.sha}}/misc/docs/020_installation.txt
cp doc/030_configuration.md publish/quake2-linux-${{github.sha}}/misc/docs/030_configuration.txt
cp doc/040_cvarlist.md publish/quake2-linux-${{github.sha}}/misc/docs/040_cvarlist.txt
cp doc/050_commands.md publish/quake2-linux-${{github.sha}}/misc/docs/050_commands.txt
cp doc/060_multiplayer.md publish/quake2-linux-${{github.sha}}/misc/docs/060_multiplayer.txt
cp doc/070_packaging.md publish/quake2-linux-${{github.sha}}/misc/docs/070_packaging.txt
cp doc/080_contributing.md publish/quake2-linux-${{github.sha}}/misc/docs/080_contributing.txt
cp doc/090_filelists.md publish/quake2-linux-${{github.sha}}/misc/docs/090_filelists.md
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
name: quake2-linux-${{github.sha}}
path: publish/
if-no-files-found: error

View file

@ -1,11 +1,19 @@
name: Build macos application
run-name: macos
name: Testbuild for MacOS
run-name: testbuild_macos
on:
push:
tags:
- "*"
branches:
- 'master'
pull_request:
types:
- opened
- edited
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build64:
build_macos_aarch64:
runs-on: macos-latest
strategy:
fail-fast: false
@ -13,26 +21,40 @@ jobs:
include:
- env: macos
steps:
- name: Install build libraries
- name: Install build dependencies
run: |
brew update
brew install sdl2 openal-soft make ffmpeg molten-vk
brew upgrade
- name: Check out repository code
uses: actions/checkout@v4
- name: Build Release code
- name: Build
run: |
gmake
- name: Create release package
# Public runners come with 3 CPUs.
gmake -j3
- name: Create testbuild package
run: |
# copy docs
cp -rv stuff/mapfixes/* LICENSE README.md doc release/
# 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
# Create release directory tree
mkdir -p publish/quake2-macos-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-macos-${{github.sha}}/
# Copy misc assets
cp -r stuff/yq2.cfg publish/quake2-macos-${{github.sha}}/misc/yq2.cfg
cp -r stuff/mapfixes publish/quake2-macos-${{github.sha}}/misc
cp LICENSE publish/quake2-macos-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-macos-${{github.sha}}/misc/docs/README.txt
cp doc/010_index.md publish/quake2-macos-${{github.sha}}/misc/docs/010_index.txt
cp doc/020_installation.md publish/quake2-macos-${{github.sha}}/misc/docs/020_installation.txt
cp doc/030_configuration.md publish/quake2-macos-${{github.sha}}/misc/docs/030_configuration.txt
cp doc/040_cvarlist.md publish/quake2-macos-${{github.sha}}/misc/docs/040_cvarlist.txt
cp doc/050_commands.md publish/quake2-macos-${{github.sha}}/misc/docs/050_commands.txt
cp doc/060_multiplayer.md publish/quake2-macos-${{github.sha}}/misc/docs/060_multiplayer.txt
cp doc/070_packaging.md publish/quake2-macos-${{github.sha}}/misc/docs/070_packaging.txt
cp doc/080_contributing.md publish/quake2-macos-${{github.sha}}/misc/docs/080_contributing.txt
cp doc/090_filelists.md publish/quake2-macos-${{github.sha}}/misc/docs/090_filelists.md
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
files: |
yquake2remaster-${{matrix.env}}-${{github.ref_name}}.zip
name: quake2-macos-${{github.sha}}
path: publish/
if-no-files-found: error

103
.github/workflows/win32.yml vendored Normal file
View file

@ -0,0 +1,103 @@
name: Testbuild for Win32
run-name: testbuild_win32
on:
push:
branches:
- 'master'
tags:
- "*"
pull_request:
types:
- opened
- edited
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_mingw_x86_32:
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}}-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
shell: msys2 {0}
run: |
sed -i 's|WITH_AVCODEC:=yes|WITH_AVCODEC:=no|g' Makefile
# Public runners come with 2 CPUs.
make -j2
- name: Create testbuild package
shell: msys2 {0}
run: |
# Create release directory tree
mkdir -p publish/quake2-win32-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-win32-${{github.sha}}/
# Copy misc assets
cp -r stuff/yq2.cfg publish/quake2-win32-${{github.sha}}/misc/yq2.cfg
cp -r stuff/mapfixes publish/quake2-win32-${{github.sha}}/misc
cp LICENSE publish/quake2-win32-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-win32-${{github.sha}}/misc/docs/README.txt
cp doc/010_index.md publish/quake2-win32-${{github.sha}}/misc/docs/010_index.txt
cp doc/020_installation.md publish/quake2-win32-${{github.sha}}/misc/docs/020_installation.txt
cp doc/030_configuration.md publish/quake2-win32-${{github.sha}}/misc/docs/030_configuration.txt
cp doc/040_cvarlist.md publish/quake2-win32-${{github.sha}}/misc/docs/040_cvarlist.txt
cp doc/050_commands.md publish/quake2-win32-${{github.sha}}/misc/docs/050_commands.txt
cp doc/060_multiplayer.md publish/quake2-win32-${{github.sha}}/misc/docs/060_multiplayer.txt
cp doc/070_packaging.md publish/quake2-win32-${{github.sha}}/misc/docs/070_packaging.txt
cp doc/080_contributing.md publish/quake2-win32-${{github.sha}}/misc/docs/080_contributing.txt
cp doc/090_filelists.md publish/quake2-win32-${{github.sha}}/misc/docs/090_filelists.md
# SDL2
wget -c https://github.com/libsdl-org/SDL/releases/download/release-2.30.6/SDL2-2.30.6-win32-x86.zip
unzip -o SDL2-2.30.6-win32-x86.zip
cp SDL2.dll publish/quake2-win32-${{github.sha}}/
# openal-soft
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 publish/quake2-win32-${{github.sha}}/openal32.dll
# curl (releases use a custom build curl.dll)
wget -c https://curl.se/windows/dl-8.9.1_1/curl-8.9.1_1-win32-mingw.zip
unzip -o curl-8.9.1_1-win32-mingw.zip
cp curl-8.9.1_1-win32-mingw/bin/libcurl.dll publish/quake2-win32-${{github.sha}}/curl.dll
- name: Upload testbuild package
uses: actions/upload-artifact@v4
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
name: quake2-win32-${{github.sha}}
path: publish/
if-no-files-found: error
- name: Create testbuild package
if: ${{ startsWith(github.ref, 'refs/tags/') }}
shell: msys2 {0}
run: |
# create archive
mkdir yquake2remaster-${{matrix.env}}-${{github.ref_name}}
cp -rv publish/quake2-win32-${{github.sha}}/* 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
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: |
yquake2remaster-${{matrix.env}}-${{github.ref_name}}.zip

109
.github/workflows/win64.yml vendored Normal file
View file

@ -0,0 +1,109 @@
name: Testbuild for Win64
run-name: testbuild_win64
on:
push:
branches:
- 'master'
tags:
- "*"
pull_request:
types:
- opened
- edited
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_mingw_x86_64:
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
shell: msys2 {0}
run: |
# Public runners come with 2 CPUs.
make -j2
- name: Create testbuild package
shell: msys2 {0}
run: |
# Create release directory tree
mkdir -p publish/quake2-win64-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-win64-${{github.sha}}/
# Copy misc assets
cp -r stuff/yq2.cfg publish/quake2-win64-${{github.sha}}/misc/yq2.cfg
cp -r stuff/mapfixes publish/quake2-win64-${{github.sha}}/misc
cp LICENSE publish/quake2-win64-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-win64-${{github.sha}}/misc/docs/README.txt
cp doc/010_index.md publish/quake2-win64-${{github.sha}}/misc/docs/010_index.txt
cp doc/020_installation.md publish/quake2-win64-${{github.sha}}/misc/docs/020_installation.txt
cp doc/030_configuration.md publish/quake2-win64-${{github.sha}}/misc/docs/030_configuration.txt
cp doc/040_cvarlist.md publish/quake2-win64-${{github.sha}}/misc/docs/040_cvarlist.txt
cp doc/050_commands.md publish/quake2-win64-${{github.sha}}/misc/docs/050_commands.txt
cp doc/060_multiplayer.md publish/quake2-win64-${{github.sha}}/misc/docs/060_multiplayer.txt
cp doc/070_packaging.md publish/quake2-win64-${{github.sha}}/misc/docs/070_packaging.txt
cp doc/080_contributing.md publish/quake2-win64-${{github.sha}}/misc/docs/080_contributing.txt
cp doc/090_filelists.md publish/quake2-win64-${{github.sha}}/misc/docs/090_filelists.md
# SDL2
wget -c https://github.com/libsdl-org/SDL/releases/download/release-2.30.6/SDL2-2.30.6-win32-x86.zip
unzip -o SDL2-2.30.6-win32-x86.zip
cp SDL2.dll publish/quake2-win64-${{github.sha}}/
# 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 publish/quake2-win64-${{github.sha}}/
# remove unused libraries
rm -fv publish/quake2-win64-${{github.sha}}/avdevice*.dll publish/quake2-win64-${{github.sha}}/avfilter*.dll publish/quake2-win64-${{github.sha}}/postproc*.dll
# openal-soft
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 publish/quake2-win64-${{github.sha}}/openal32.dll
# curl (releases use a custom build curl.dll)
wget -c https://curl.se/windows/dl-8.9.1_1/curl-8.9.1_1-win64-mingw.zip
unzip -o curl-8.9.1_1-win64-mingw.zip
cp curl-8.9.1_1-win64-mingw/bin/libcurl-x64.dll publish/quake2-win64-${{github.sha}}/curl.dll
- name: Upload testbuild package
uses: actions/upload-artifact@v4
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
name: quake2-win64-${{github.sha}}
path: publish/
if-no-files-found: error
- name: Create tag package
if: ${{ startsWith(github.ref, 'refs/tags/') }}
shell: msys2 {0}
run: |
# create archive
mkdir yquake2remaster-${{matrix.env}}-${{github.ref_name}}
cp -rv publish/quake2-win64-${{github.sha}}/* 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
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: |
yquake2remaster-${{matrix.env}}-${{github.ref_name}}.zip

View file

@ -1,127 +0,0 @@
name: Build windows application
run-name: windows
on:
push:
tags:
- "*"
jobs:
build_x86_64:
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
build_x86_32:
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}}-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