Simplify buildsteps and use Ubuntu 24.04 runner for MinGW. #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Prepare 32-bit Multiarch | |
run: sudo dpkg --add-architecture i386 | |
- name: Update Packages | |
run: sudo apt-get update | |
- name: Install LuaJIT Development Libraries (i386) | |
run: sudo apt-get install --assume-yes gcc-multilib libluajit-5.1-dev:i386 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: cs2djit | |
submodules: true | |
- name: Configure | |
run: CFLAGS=-m32 cmake -Bbuild -Scs2djit --install-prefix $PWD/install -DCMAKE_BUILD_TYPE=Release | |
- name: Install | |
run: cmake --build build --target install | |
- name: Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cs2djit-linux | |
path: install/bin | |
build-windows: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Update Packages | |
run: sudo apt-get update | |
- name: Install MinGW-w64 Toolchain And LuaJIT (for host) | |
run: sudo apt-get install --assume-yes mingw-w64 gcc-multilib build-essential luajit | |
- name: Clone LuaJIT (For Target) | |
uses: actions/checkout@v4 | |
with: | |
repository: LuaJIT/LuaJIT | |
path: LuaJIT | |
ref: v2.1 | |
- name: Build LuaJIT (For Target) | |
run: cd LuaJIT && make TARGET_FLAGS="-static-libgcc" HOST_CC="gcc -m32" CROSS=i686-w64-mingw32- TARGET_SYS=Windows HOST_LUA=luajit amalg | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: cs2djit | |
submodules: true | |
- name: Configure | |
run: LUAJIT_DIR=$PWD/LuaJIT/src cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/cs2djit/cmake/mingw-w64.cmake -Bbuild -Scs2djit --install-prefix $PWD/install -DCMAKE_BUILD_TYPE=Release | |
- name: Install | |
run: cmake --build build --target install | |
- name: Copy lua51.dll to Install | |
run: cp LuaJIT/src/lua51.dll install/bin/lua51.dll | |
- name: Strip | |
run: cd install/bin && strip lua51.dll && strip cs2djit.dll && strip cs2djitwrapper.exe | |
- name: Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cs2djit-windows | |
path: install/bin |