16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-09-01 10:29:18 +02:00

Merge pull request #158 from MaSzyna-EU07/migrate-to-actions

Migrate to actions
This commit is contained in:
2026-08-20 23:11:27 +02:00
committed by GitHub
4 changed files with 254 additions and 235 deletions

253
.github/workflows/build_bin.yml vendored Normal file
View File

@@ -0,0 +1,253 @@
name: Build binaries
on:
push:
branches:
- "**"
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:
permissions:
contents: read
env:
CONFIG_WIN: RelWithDebInfo
CONFIG_LINUX: Release
jobs:
# ============================================================
# Windows / MSVC
# ============================================================
windows:
name: Windows x64 / MSVC
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Setup Python 3.14
id: python
uses: actions/setup-python@v6
with:
python-version: "3.14"
architecture: "x64"
- name: Show environment
shell: pwsh
run: |
python --version
cmake --version
Write-Host "Python:"
Get-Command python
Write-Host "MSVC:"
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
-latest `
-products * `
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
-property installationPath
# README: bootstrap vcpkg + install DirectX DXC
- name: Prepare Windows dependencies
shell: cmd
run: |
call setup.bat
- name: Configure
shell: pwsh
run: |
$pythonExe = "${{ steps.python.outputs.python-path }}"
$pythonRoot = Split-Path $pythonExe
Write-Host "Python root: $pythonRoot"
cmake -S . -B build `
-G "Visual Studio 17 2022" `
-A x64 `
"-DPython3_ROOT_DIR=$pythonRoot"
- name: Build
shell: pwsh
run: |
cmake --build build `
--config $env:CONFIG_WIN `
--parallel
- name: Copy shaders
shell: pwsh
run: |
$output = "build/bin/$env:CONFIG_WIN"
New-Item `
-ItemType Directory `
-Force `
-Path "$output/shaders" | Out-Null
Copy-Item `
-Path "shaders/*" `
-Destination "$output/shaders" `
-Recurse `
-Force
- name: Upload Windows build
uses: actions/upload-artifact@v4
with:
name: maszyna-windows-x64-${{ env.CONFIG_WIN }}
path: |
build/bin/${{ env.CONFIG_WIN }}/
if-no-files-found: error
retention-days: 14
- name: Upload Windows debug symbols
uses: actions/upload-artifact@v4
with:
name: maszyna-windows-x64-symbols-${{ env.CONFIG_WIN }}
path: |
build/pdb/${{ env.CONFIG_WIN }}/*.pdb
build/bin/${{ env.CONFIG_WIN }}/*.map
if-no-files-found: warn
retention-days: 14
# ============================================================
# Linux / GCC
# ============================================================
linux:
name: Linux x64 / GCC
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Setup Python 3.14
id: python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libgl1-mesa-dev \
libglew-dev \
libglfw3-dev \
libpng-dev \
libopenal-dev \
libluajit-5.1-dev \
libserialport-dev \
libsndfile1-dev \
xorg-dev \
libxkbcommon-dev \
libwayland-dev \
wayland-protocols
#
# Existing MaSzyna CI already builds OpenAL Soft 1.24.2,
# so retain that instead of relying only on Ubuntu's package.
#
- name: Build OpenAL Soft
run: |
git clone \
--depth 1 \
--branch 1.24.2 \
https://github.com/kcat/openal-soft.git \
/tmp/openal-soft
cmake \
-S /tmp/openal-soft \
-B /tmp/openal-soft/build \
-DCMAKE_BUILD_TYPE=Release \
-DALSOFT_EXAMPLES=OFF \
-DALSOFT_UTILS=OFF
cmake \
--build /tmp/openal-soft/build \
--parallel "$(nproc)"
sudo cmake \
--install /tmp/openal-soft/build
sudo ldconfig
- name: Show environment
run: |
gcc --version
g++ --version
cmake --version
python --version
- name: Configure
run: |
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE="${CONFIG_LINUX}" \
-DWITH_BETTER_RENDERER=OFF \
-DWITH_ZMQ=OFF \
-DWITH_OPENVR=OFF \
-DUSE_LTO=OFF \
-DPython3_EXECUTABLE="${{ steps.python.outputs.python-path }}" \
-DCMAKE_CXX_FLAGS="-Wno-attributes -fno-inline-functions-called-once"
- name: Build
run: |
cmake \
--build build \
--parallel "$(nproc)"
- name: Prepare Linux Python environment
run: |
PYTHON_ROOT="$(python -c 'import sys; print(sys.base_prefix)')"
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
PYTHON_HOME="$GITHUB_WORKSPACE/build/bin/linuxpython64"
echo "Python root: $PYTHON_ROOT"
echo "Python version: $PYTHON_VERSION"
echo "Embedded Python home: $PYTHON_HOME"
python -m venv --copies "$PYTHON_HOME"
cp -a \
"$PYTHON_ROOT/lib/python${PYTHON_VERSION}/." \
"$PYTHON_HOME/lib/python${PYTHON_VERSION}/"
"$PYTHON_HOME/bin/python" -m pip install --upgrade pip
"$PYTHON_HOME/bin/python" -m pip install --no-cache-dir Pillow
"$PYTHON_HOME/bin/python" -c "from PIL import Image; print('Pillow:', Image.__version__)"
- name: Copy shaders
run: |
mkdir -p build/bin/shaders
cp -R shaders/. build/bin/shaders/
- name: Upload Linux build
uses: actions/upload-artifact@v4
with:
name: maszyna-linux-x64-${{ env.CONFIG_LINUX }}
path: |
build/bin/
if-no-files-found: error
retention-days: 14

View File

@@ -6,7 +6,7 @@
[Website](https://eu07.pl/) · [Report an issue](https://github.com/MaSzyna-EU07/maszyna/issues) · [Community Discord](https://discord.gg/eu07) · [MaSzyna on Steam](https://store.steampowered.com/app/1033030/MaSzyna/) · [MaSzyna on Epic Games Store](https://store.epicgames.com/pl/p/maszyna-79052a) [Website](https://eu07.pl/) · [Report an issue](https://github.com/MaSzyna-EU07/maszyna/issues) · [Community Discord](https://discord.gg/eu07) · [MaSzyna on Steam](https://store.steampowered.com/app/1033030/MaSzyna/) · [MaSzyna on Epic Games Store](https://store.epicgames.com/pl/p/maszyna-79052a)
![Discord](https://img.shields.io/discord/1019306167803056158?style=flat-square&logo=discord&label=Discord&labelColor=white) ![AppVeyor Build](https://img.shields.io/appveyor/build/Hirek193/maszyna?style=flat-square) ![Quality gate](https://img.shields.io/sonar/quality_gate/MaSzyna-EU07_maszyna?server=https%3A%2F%2Fsonarcloud.io&style=flat-square ![Discord](https://img.shields.io/discord/1019306167803056158?style=flat-square&logo=discord&label=Discord&labelColor=white) ![Github Actions](https://img.shields.io/github/actions/workflow/status/MaSzyna-EU07/maszyna/build_bin.yml?style=flat-square ) ![Quality gate](https://img.shields.io/sonar/quality_gate/MaSzyna-EU07_maszyna?server=https%3A%2F%2Fsonarcloud.io&style=flat-square
) ![Sonar cloud violations](https://img.shields.io/sonar/violations/MaSzyna-EU07_maszyna?server=https%3A%2F%2Fsonarcloud.io&format=long&style=flat-square ) ![Sonar cloud violations](https://img.shields.io/sonar/violations/MaSzyna-EU07_maszyna?server=https%3A%2F%2Fsonarcloud.io&format=long&style=flat-square
) [![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg?style=flat-square)](LICENSE) [![Last commit](https://img.shields.io/github/last-commit/MaSzyna-EU07/maszyna?style=flat-square&label=Last%20commit)](https://github.com/MaSzyna-EU07/maszyna/commits/master) [![Open issues](https://img.shields.io/github/issues/MaSzyna-EU07/maszyna?style=flat-square&label=Issues)](https://github.com/MaSzyna-EU07/maszyna/issues) [![Pull requests](https://img.shields.io/github/issues-pr/MaSzyna-EU07/maszyna?style=flat-square&label=Pull%20requests)](https://github.com/MaSzyna-EU07/maszyna/pulls) [![GitHub stars](https://img.shields.io/github/stars/MaSzyna-EU07/maszyna?style=flat-square&logo=github&label=Stars)](https://github.com/MaSzyna-EU07/maszyna/stargazers) [![GitHub forks](https://img.shields.io/github/forks/MaSzyna-EU07/maszyna?style=flat-square&logo=github&label=Forks)](https://github.com/MaSzyna-EU07/maszyna/forks) ![C++](https://img.shields.io/badge/C%2B%2B-17-00599C?style=flat-square&logo=cplusplus) ![Windows](https://img.shields.io/badge/platform-Windows-0078D6?style=flat-square&logo=windows) ![Linux](https://img.shields.io/badge/platform-Linux-FCC624?style=flat-square&logo=linux&logoColor=black) ![OpenGL](https://img.shields.io/badge/OpenGL-3.3%2B-5586A4?style=flat-square&logo=opengl) ) [![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg?style=flat-square)](LICENSE) [![Last commit](https://img.shields.io/github/last-commit/MaSzyna-EU07/maszyna?style=flat-square&label=Last%20commit)](https://github.com/MaSzyna-EU07/maszyna/commits/master) [![Open issues](https://img.shields.io/github/issues/MaSzyna-EU07/maszyna?style=flat-square&label=Issues)](https://github.com/MaSzyna-EU07/maszyna/issues) [![Pull requests](https://img.shields.io/github/issues-pr/MaSzyna-EU07/maszyna?style=flat-square&label=Pull%20requests)](https://github.com/MaSzyna-EU07/maszyna/pulls) [![GitHub stars](https://img.shields.io/github/stars/MaSzyna-EU07/maszyna?style=flat-square&logo=github&label=Stars)](https://github.com/MaSzyna-EU07/maszyna/stargazers) [![GitHub forks](https://img.shields.io/github/forks/MaSzyna-EU07/maszyna?style=flat-square&logo=github&label=Forks)](https://github.com/MaSzyna-EU07/maszyna/forks) ![C++](https://img.shields.io/badge/C%2B%2B-17-00599C?style=flat-square&logo=cplusplus) ![Windows](https://img.shields.io/badge/platform-Windows-0078D6?style=flat-square&logo=windows) ![Linux](https://img.shields.io/badge/platform-Linux-FCC624?style=flat-square&logo=linux&logoColor=black) ![OpenGL](https://img.shields.io/badge/OpenGL-3.3%2B-5586A4?style=flat-square&logo=opengl)

View File

@@ -1,44 +0,0 @@
version: '{build}'
image: Visual Studio 2022
# Używamy własnych kroków build
build: off
# Zmienna z konfiguracją
environment:
CONFIG: RelWithDebInfo
init:
- cmd: |
echo Build worker: %APPVEYOR_BUILD_WORKER_IMAGE%
ver
install:
- cmd: |
git submodule update --init --recursive
call setup-ci.bat
before_build:
- cmd: |
if not exist build mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%CONFIG% -DPython3_ROOT_DIR=C:/Python314-x64
build_script:
- cmd: |
cmake --build . --config %CONFIG% --parallel
cd ..
after_build:
- cmd: |
echo Copying shaders...
if not exist build\bin\%CONFIG%\shaders mkdir build\bin\%CONFIG%\shaders
xcopy /E /Y shaders build\bin\%CONFIG%\shaders\
artifacts:
- path: build\bin\%CONFIG%\*.exe
name: binaries
- path: build\pdb\%CONFIG%\*.pdb
name: symbols
- path: build\bin\%CONFIG%\shaders
name: shaders

View File

@@ -1,190 +0,0 @@
jobs:
- job: validateshaders
pool:
vmImage: 'ubuntu-20.04'
displayName: 'Validate shaders'
steps:
- script: |
sudo apt-get update -y
sudo apt-get install -y glslang-tools
displayName: 'Install dependencies'
- script: |
cd ci_shadervalidator
./build.sh
displayName: 'Build validator'
- script: |
cd ci_shadervalidator
./validateshaders
displayName: 'Validate shaders'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'shaders'
artifactName: shaders
displayName: 'Publish shaders'
- job: ubuntu2004
pool:
vmImage: 'Ubuntu-20.04'
displayName: 'Ubuntu 20.04 x86-64'
steps:
- script: |
sudo apt-get update -y
sudo apt-get install -y libglfw3-dev python3.14-dev libpng-dev libopenal-dev libluajit-5.1-dev libserialport-dev libsndfile1-dev
cd ref
git clone "https://github.com/chriskohlhoff/asio" --depth 1 --branch asio-1-12-2 -q
displayName: 'Install dependencies'
- script: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_ZMQ=OFF -DWITH_OPENVR=OFF -DUSE_LTO=ON
cmake --build .
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'build/bin'
artifactName: binaries_linux
displayName: 'Publish binaries'
- job: macos11
pool:
vmImage: 'macOS-11'
displayName: 'MacOS 11 x86-64'
steps:
- script: |
sudo xcode-select -s /Applications/Xcode_12.4.app
displayName: 'Setup Xcode'
- script: |
cd /tmp
wget https://s2.milek7.pl/macos_vcpkg_cache_x64.tar.gz
tar -xf macos_vcpkg_cache_x64.tar.gz
mv tmp/vcpkg vcpkg
rmdir tmp
rm macos_vcpkg_cache_x64.tar.gz
displayName: 'Install dependencies'
- script: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_TOOLCHAIN_FILE=/tmp/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-osx -DWITH_ZMQ=OFF -DWITH_OPENVR=OFF -DWITH_UART=OFF -DUSE_LTO=ON -DWITH_LUA=OFF
cmake --build .
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'build/bin'
artifactName: binaries_macos
displayName: 'Publish binaries'
- job: macos11_arm64
pool:
vmImage: 'macOS-11'
displayName: 'MacOS 11 ARM64'
steps:
- script: |
sudo xcode-select -s /Applications/Xcode_12.4.app
displayName: 'Setup Xcode'
- script: |
cd /tmp
wget https://s2.milek7.pl/macos_vcpkg_cache_arm64.tar.gz
tar -xf macos_vcpkg_cache_arm64.tar.gz
mv tmp/vcpkg vcpkg
rmdir tmp
rm macos_vcpkg_cache_arm64.tar.gz
displayName: 'Install dependencies'
- script: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_TOOLCHAIN_FILE=/tmp/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=arm64-osx -DWITH_ZMQ=OFF -DWITH_OPENVR=OFF -DWITH_UART=OFF -DUSE_LTO=ON -DWITH_LUA=OFF
cmake --build .
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'build/bin'
artifactName: binaries_macos_arm64
displayName: 'Publish binaries'
- job: windows_x64
pool:
vmImage: 'windows-2019'
displayName: 'Windows VS2019 x86-64'
steps:
- script: |
cd ref
git clone "https://github.com/chriskohlhoff/asio" --depth 1 --branch asio-1-12-2 -q
curl -o crashpad.zip "http://get.backtrace.io/crashpad/builds/release/x86-64/crashpad-2020-07-01-release-x64-558c9614e3819179f30b92541450f5ac643afce5.zip"
unzip crashpad.zip
move crashpad-2020-07-01-release-x64-558c9614e3819179f30b92541450f5ac643afce5 crashpad
displayName: 'Download extra dependencies'
- script: |
mkdir build
cd build
cmake .. -A x64 -DUSE_LTO=ON -DWITH_CRASHPAD=ON
cmake --build . --config RelWithDebInfo
displayName: 'Build'
- script: |
cd build
7z a package.zip .\bin\RelWithDebInfo\*.exe .\pdb\RelWithDebInfo\*.pdb
curl --data-binary @package.zip -H "Expect:" "https://eu07.sp.backtrace.io:6098/post?format=symbols&token=4eeba9395fae661927e23679fc36f2237416ec056ef75399e894d597ad518c6c"
del .\bin\RelWithDebInfo\*.iobj
del .\bin\RelWithDebInfo\*.ipdb
displayName: 'Upload symbols'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'build/bin'
artifactName: binaries_win64
displayName: 'Publish binaries'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'build/package.zip'
artifactName: symbols_win64
displayName: 'Publish symbols'
- job: windows_x64_dbg
pool:
vmImage: 'windows-2019'
displayName: 'Windows VS2019 Debug'
steps:
- script: |
cd ref
git clone "https://github.com/chriskohlhoff/asio" --depth 1 --branch asio-1-12-2 -q
displayName: 'Download extra dependencies'
- script: |
mkdir build
cd build
cmake .. -A x64
cmake --build . --config Debug
displayName: 'Build'
- job: windows_x32
pool:
vmImage: 'windows-2019'
displayName: 'Windows VS2019 x86'
steps:
- script: |
cd ref
git clone "https://github.com/chriskohlhoff/asio" --depth 1 --branch asio-1-12-2 -q
curl -o crashpad.zip "http://get.backtrace.io/crashpad/builds/release/x86/crashpad-2020-07-01-release-x86-558c9614e3819179f30b92541450f5ac643afce5.zip"
unzip crashpad.zip
move crashpad-2020-07-01-release-x86-558c9614e3819179f30b92541450f5ac643afce5 crashpad
displayName: 'Download extra dependencies'
- script: |
mkdir build
cd build
cmake .. -A Win32 -T v141_xp -DUSE_LTO=ON -DWITH_CRASHPAD=ON
cmake --build . --config RelWithDebInfo
displayName: 'Build'
- script: |
cd build
7z a package.zip .\pdb\RelWithDebInfo\*.pdb
curl --data-binary @package.zip -H "Expect:" "https://eu07.sp.backtrace.io:6098/post?format=symbols&token=4eeba9395fae661927e23679fc36f2237416ec056ef75399e894d597ad518c6c"
del .\bin\RelWithDebInfo\*.iobj
del .\bin\RelWithDebInfo\*.ipdb
displayName: 'Upload symbols'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'build/bin'
artifactName: binaries_win32
displayName: 'Publish binaries'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'build/package.zip'
artifactName: symbols_win32
displayName: 'Publish symbols'