2023-12-20 21:35:19 +01:00
|
|
|
name: windows
|
2020-04-20 20:18:40 +02:00
|
|
|
|
|
|
|
# build on c/cpp changes or workflow changes
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- 'lib/**.[ch]'
|
|
|
|
- 'lib/**.cpp'
|
|
|
|
- 'src/**.[ch]'
|
|
|
|
- 'src/**.cpp'
|
|
|
|
- '**/CMakeLists.txt'
|
|
|
|
- 'cmake/Modules/**'
|
|
|
|
- 'util/buildbot/**'
|
2023-12-19 20:19:39 +01:00
|
|
|
- 'misc/irrlichtmt_tag.txt'
|
|
|
|
- 'misc/*.manifest'
|
2023-12-20 21:35:19 +01:00
|
|
|
- '.github/workflows/windows.yml'
|
2020-04-20 20:18:40 +02:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'lib/**.[ch]'
|
|
|
|
- 'lib/**.cpp'
|
|
|
|
- 'src/**.[ch]'
|
|
|
|
- 'src/**.cpp'
|
|
|
|
- '**/CMakeLists.txt'
|
|
|
|
- 'cmake/Modules/**'
|
|
|
|
- 'util/buildbot/**'
|
2023-12-19 20:19:39 +01:00
|
|
|
- 'misc/irrlichtmt_tag.txt'
|
|
|
|
- 'misc/*.manifest'
|
2023-12-20 21:35:19 +01:00
|
|
|
- '.github/workflows/windows.yml'
|
2022-10-19 23:58:36 +02:00
|
|
|
|
2020-04-20 20:18:40 +02:00
|
|
|
jobs:
|
2023-12-20 21:35:19 +01:00
|
|
|
mingw32:
|
2020-05-02 12:52:51 +02:00
|
|
|
name: "MinGW cross-compiler (32-bit)"
|
2023-12-13 12:54:44 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2020-04-20 20:18:40 +02:00
|
|
|
steps:
|
2022-05-01 14:44:48 +02:00
|
|
|
- uses: actions/checkout@v3
|
2020-04-20 20:18:40 +02:00
|
|
|
- name: Install compiler
|
|
|
|
run: |
|
2022-05-01 14:44:48 +02:00
|
|
|
sudo apt-get update && sudo apt-get install -y gettext
|
2023-12-13 00:19:11 +01:00
|
|
|
sudo ./util/buildbot/download_toolchain.sh i686 /usr
|
2020-04-20 20:18:40 +02:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2023-12-13 00:04:58 +01:00
|
|
|
EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh B
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: mingw32
|
|
|
|
path: B/build/*.zip
|
|
|
|
if-no-files-found: error
|
2020-04-20 20:18:40 +02:00
|
|
|
|
2023-12-20 21:35:19 +01:00
|
|
|
mingw64:
|
2020-05-02 12:52:51 +02:00
|
|
|
name: "MinGW cross-compiler (64-bit)"
|
2023-12-13 12:54:44 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2020-04-20 20:18:40 +02:00
|
|
|
steps:
|
2022-05-01 14:44:48 +02:00
|
|
|
- uses: actions/checkout@v3
|
2020-04-20 20:18:40 +02:00
|
|
|
- name: Install compiler
|
|
|
|
run: |
|
2022-05-01 14:44:48 +02:00
|
|
|
sudo apt-get update && sudo apt-get install -y gettext
|
2023-12-13 00:19:11 +01:00
|
|
|
sudo ./util/buildbot/download_toolchain.sh x86_64 /usr
|
2020-04-27 08:31:51 +02:00
|
|
|
|
2020-04-20 20:18:40 +02:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2023-12-13 00:04:58 +01:00
|
|
|
EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh B
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: mingw64
|
|
|
|
path: B/build/*.zip
|
|
|
|
if-no-files-found: error
|
2020-05-05 08:42:55 +02:00
|
|
|
|
|
|
|
msvc:
|
|
|
|
name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
|
2021-03-07 13:58:27 +01:00
|
|
|
runs-on: windows-2019
|
2020-05-05 08:42:55 +02:00
|
|
|
env:
|
2023-11-19 16:20:17 +01:00
|
|
|
VCPKG_VERSION: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50
|
|
|
|
# 2023.10.19
|
2023-06-24 20:38:31 +02:00
|
|
|
vcpkg_packages: zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp opengl-registry
|
2020-05-05 08:42:55 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- {
|
|
|
|
arch: x86,
|
|
|
|
generator: "-G'Visual Studio 16 2019' -A Win32",
|
|
|
|
vcpkg_triplet: x86-windows
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
arch: x64,
|
|
|
|
generator: "-G'Visual Studio 16 2019' -A x64",
|
|
|
|
vcpkg_triplet: x64-windows
|
|
|
|
}
|
|
|
|
type: [portable]
|
|
|
|
# type: [portable, installer]
|
|
|
|
# The installer type is working, but disabled, to save runner jobs.
|
|
|
|
# Enable it, when working on the installer.
|
|
|
|
|
|
|
|
steps:
|
2022-05-01 14:44:48 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-05-04 23:55:02 +02:00
|
|
|
|
2022-05-01 14:44:48 +02:00
|
|
|
- name: Checkout IrrlichtMt
|
2022-07-21 20:51:02 +02:00
|
|
|
run: |
|
|
|
|
$ref = @(Get-Content misc\irrlichtmt_tag.txt)
|
|
|
|
git clone https://github.com/minetest/irrlicht lib\irrlichtmt --depth 1 -b $ref[0]
|
2020-05-05 08:42:55 +02:00
|
|
|
|
|
|
|
- name: Restore from cache and run vcpkg
|
2022-05-04 23:55:02 +02:00
|
|
|
uses: lukka/run-vcpkg@v7
|
2020-05-05 08:42:55 +02:00
|
|
|
with:
|
|
|
|
vcpkgArguments: ${{env.vcpkg_packages}}
|
|
|
|
vcpkgDirectory: '${{ github.workspace }}\vcpkg'
|
|
|
|
appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
|
|
|
|
vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
|
|
|
|
vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
|
|
|
|
|
2022-05-04 23:55:02 +02:00
|
|
|
- name: Minetest CMake
|
2020-05-05 08:42:55 +02:00
|
|
|
run: |
|
|
|
|
cmake ${{matrix.config.generator}} `
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
|
|
|
|
-DCMAKE_BUILD_TYPE=Release `
|
2020-06-22 17:17:36 +02:00
|
|
|
-DENABLE_POSTGRESQL=OFF `
|
2023-06-22 17:52:35 +02:00
|
|
|
-DENABLE_LUAJIT=TRUE `
|
|
|
|
-DREQUIRE_LUAJIT=TRUE `
|
2020-05-05 08:42:55 +02:00
|
|
|
-DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }} .
|
|
|
|
|
2022-05-04 23:55:02 +02:00
|
|
|
- name: Build Minetest
|
2020-05-05 08:42:55 +02:00
|
|
|
run: cmake --build . --config Release
|
|
|
|
|
2024-01-15 20:03:32 +01:00
|
|
|
- name: Unittests
|
|
|
|
# need this workaround for stdout to work
|
|
|
|
run: |
|
|
|
|
$proc = start .\bin\Release\minetest.exe --run-unittests -NoNewWindow -Wait -PassThru
|
|
|
|
exit $proc.ExitCode
|
|
|
|
|
2020-05-05 08:42:55 +02:00
|
|
|
- name: CPack
|
|
|
|
run: |
|
|
|
|
If ($env:TYPE -eq "installer")
|
|
|
|
{
|
|
|
|
cpack -G WIX -B "$env:GITHUB_WORKSPACE\Package"
|
|
|
|
}
|
|
|
|
ElseIf($env:TYPE -eq "portable")
|
|
|
|
{
|
|
|
|
cpack -G ZIP -B "$env:GITHUB_WORKSPACE\Package"
|
|
|
|
}
|
2024-01-15 20:03:32 +01:00
|
|
|
rm -r $env:GITHUB_WORKSPACE\Package\_CPack_Packages
|
2020-05-05 08:42:55 +02:00
|
|
|
env:
|
|
|
|
TYPE: ${{matrix.type}}
|
|
|
|
|
2022-05-01 14:44:48 +02:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-05-05 08:42:55 +02:00
|
|
|
with:
|
|
|
|
name: msvc-${{ matrix.config.arch }}-${{ matrix.type }}
|
|
|
|
path: .\Package\
|
2023-12-20 21:35:19 +01:00
|
|
|
if-no-files-found: error
|