various fixes for building with shared libraries #90
Workflow file for this run
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, pull_request, workflow_dispatch] | |
jobs: | |
check-shared: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Ensure dependencies are installed | |
run: | | |
sudo apt-get install -y libssl-dev libpcre2-dev zlib1g-dev lua-luv-dev libluajit-5.1-dev luajit | |
- name: Configure | |
run: make regular WITH_SHARED_LIBLUV=ON WITH_SHARED_OPENSSL=ON WITH_SHARED_PCRE2=ON WITH_SHARED_ZLIB=ON | |
- name: Build | |
run: make | |
- name: Test | |
run: make test | |
build-posix: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-13, macos-latest] | |
build_type: [tiny, regular] | |
lua_engine: [LuaJIT, Lua] | |
env: | |
MAKEFLAGS: -j4 | |
NPROCS: 4 | |
CFLAGS: -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -Wno-nullability-completeness | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Configure | |
run: | | |
make ${{ matrix.build_type }} WITH_LUA_ENGINE=${{ matrix.lua_engine }} | |
- name: Build | |
run: make | |
- name: Test | |
run: make test | |
- name: Fetch System Name | |
run: | | |
OS=$(uname -s) | |
ARCH=$(uname -m) | |
LUA=${{ matrix.lua_engine }} | |
BUILD=${{ matrix.build_type }} | |
echo "ARTIFACT=$OS-$ARCH-$(echo $LUA | awk '{print tolower($0)}')-$BUILD" >> $GITHUB_ENV | |
- name: Rename Artifacts | |
run: | | |
cp build/luvi luvi-${{ env.ARTIFACT }} | |
- name: Publish Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT }} | |
path: | | |
luvi-${{ env.ARTIFACT }} | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [tiny, regular] | |
lua_engine: [LuaJIT, Lua] | |
arch: [x86_64, i686, aarch64] | |
libc: [glibc, musl] | |
env: | |
MAKEFLAGS: -j4 | |
NPROCS: 4 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Setup QEMU | |
if: matrix.arch == 'aarch64' | |
run: | | |
sudo apt-get install -y qemu-user-static | |
- name: Build | |
run: | | |
bash packaging/linux-run.sh ${{ matrix.libc }} ${{ matrix.arch }} ${{ matrix.build_type }} ${{ matrix.lua_engine }} | |
- name: Fetch System Name | |
run: | | |
OS=$(uname -s) | |
ARCH=${{ matrix.arch }} | |
LUA=${{ matrix.lua_engine }} | |
BUILD=${{ matrix.build_type }} | |
if [ ${{ matrix.libc }} == "glibc" ]; then | |
LIBC="" | |
else | |
LIBC=-${{ matrix.libc }} | |
fi | |
echo "ARTIFACT=$OS-$ARCH-${LUA,,}-$BUILD$LIBC" >> $GITHUB_ENV | |
- name: Rename Artifacts | |
run: | | |
cp build/luvi luvi-${{ env.ARTIFACT }} | |
- name: Publish Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT }} | |
path: | | |
luvi-${{ env.ARTIFACT }} | |
build-mingw: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [tiny, regular] | |
lua_engine: [LuaJIT, Lua] | |
msystem: [mingw32, mingw64] | |
env: | |
MAKEFLAGS: -j4 | |
NPROCS: 4 | |
steps: | |
- name: 'Setup MSYS2' | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{ matrix.msystem }} | |
update: true | |
pacboy: toolchain:p cmake:p | |
install: git | |
- name: Install NASM | |
if: matrix.build_type == 'regular' | |
run: | | |
choco install nasm | |
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Configure | |
shell: msys2 {0} | |
run: mingw32-make ${{ matrix.build_type }} WITH_LUA_ENGINE=${{ matrix.lua_engine }} GENERATOR="MinGW Makefiles" | |
- name: Build | |
shell: msys2 {0} | |
run: mingw32-make | |
- name: Test | |
shell: msys2 {0} | |
run: mingw32-make test | |
- name: Fetch System Name | |
run: | | |
$MSYSTEM="${{ matrix.msystem }}" | |
$LUA="${{ matrix.lua_engine }}" | |
$BUILD="${{ matrix.build_type }}" | |
echo "ARTIFACT=Windows-$MSYSTEM-$($LUA.ToLower())-$BUILD" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Rename Artifacts | |
run: | | |
cp build/luvi.exe luvi-${{ env.ARTIFACT }}.exe | |
- name: Publish Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT }} | |
path: luvi-${{ env.ARTIFACT }}.exe | |
build-msvc: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [tiny, regular] | |
lua_engine: [LuaJIT, Lua] | |
arch: [amd64, x86] | |
steps: | |
- name: Setup MSVC Developer Prompt | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Install NASM | |
if: matrix.build_type == 'regular' | |
run: | | |
choco install nasm | |
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Configure | |
run: nmake ${{ matrix.build_type }} WITH_LUA_ENGINE=${{ matrix.lua_engine }} | |
- name: Build | |
run: nmake | |
- name: Test | |
run: nmake test | |
- name: Fetch System Name | |
run: | | |
$ARCH="${{ matrix.arch }}" | |
$LUA="${{ matrix.lua_engine }}" | |
$BUILD="${{ matrix.build_type }}" | |
echo "ARTIFACT=Windows-$ARCH-$($LUA.ToLower())-$BUILD" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Rename Artifacts | |
run: | | |
cp build/Release/luvi.exe build/luvi-${{ env.ARTIFACT }}.exe | |
cp build/Release/luvi.lib build/luvi-${{ env.ARTIFACT }}.lib | |
cp build/Release/luvi_renamed.lib build/luvi-${{ env.ARTIFACT }}_renamed.lib | |
- name: Publish Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT }} | |
path: | | |
build/luvi-${{ env.ARTIFACT }}* | |
package-source: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Package Source | |
run: | | |
git describe --tags > VERSION | |
touch deps/luv/deps/luajit/src/luajit_relver.txt | |
tar -czvf /tmp/luvi-source.tar.gz --exclude-vcs --exclude 'git*' . | |
- name: Publish Source | |
uses: actions/upload-artifact@v4 | |
with: | |
name: luvi-source | |
path: /tmp/luvi-source.tar.gz | |
publish: | |
needs: [build-posix, build-linux, build-mingw, build-msvc, package-source, check-shared] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: download | |
merge-multiple: true | |
- name: Publish Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: download | |
- name: Create Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: download/* |