Skip to content

Build Webify

Build Webify #14

Workflow file for this run

name: Build Webify
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
ZIG_TARGET: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
target: [arc-linux-gnu, arm-freebsd-eabihf, arm-linux-gnueabi, arm-linux-gnueabihf, arm-linux-musleabi, arm-linux-musleabihf, arm-netbsd-eabi, arm-netbsd-eabihf, arm-openbsd-eabi, armeb-linux-gnueabi, armeb-linux-gnueabihf, armeb-linux-musleabi, armeb-linux-musleabihf, armeb-netbsd-eabi, armeb-netbsd-eabihf, thumb-linux-musleabi, thumb-linux-musleabihf, thumb-windows-gnu, thumbeb-linux-musleabi, thumbeb-linux-musleabihf, aarch64-freebsd-none, aarch64-linux-gnu, aarch64-linux-musl, aarch64-maccatalyst-none, aarch64-macos-none, aarch64-netbsd-none, aarch64-openbsd-none, aarch64-windows-gnu, aarch64_be-linux-gnu, aarch64_be-linux-musl, aarch64_be-netbsd-none, csky-linux-gnueabi, csky-linux-gnueabihf, hexagon-linux-musl, loongarch64-linux-gnu, loongarch64-linux-gnusf, loongarch64-linux-musl, loongarch64-linux-muslf32, loongarch64-linux-muslsf, m68k-linux-gnu, m68k-linux-musl, m68k-netbsd-none, mips-linux-gnueabi, mips-linux-gnueabihf, mips-linux-musleabi, mips-linux-musleabihf, mips-netbsd-eabi, mips-netbsd-eabihf, mipsel-linux-gnueabi, mipsel-linux-gnueabihf, mipsel-linux-musleabi, mipsel-linux-musleabihf, mipsel-netbsd-eabi, mipsel-netbsd-eabihf, mips64-linux-gnuabi64, mips64-linux-gnuabin32, mips64-linux-muslabi64, mips64-linux-muslabin32, mips64-openbsd-none, mips64el-linux-gnuabi64, mips64el-linux-gnuabin32, mips64el-linux-muslabi64, mips64el-linux-muslabin32, mips64el-openbsd-none, powerpc-linux-musleabi, powerpc-linux-musleabihf, powerpc-netbsd-eabi, powerpc-netbsd-eabihf, powerpc-openbsd-eabihf, powerpc64-freebsd-none, powerpc64-linux-musl, powerpc64-openbsd-none, powerpc64le-freebsd-none, powerpc64le-linux-gnu, powerpc64le-linux-musl, riscv32-linux-gnu, riscv32-linux-musl, riscv64-freebsd-none, riscv64-linux-gnu, riscv64-linux-musl, riscv64-openbsd-none, s390x-linux-gnu, s390x-linux-musl, sparc-linux-gnu, sparc-netbsd-none, sparc64-linux-gnu, sparc64-netbsd-none, sparc64-openbsd-none, wasm32-wasi-musl, x86-freebsd-none, x86-linux-gnu, x86-linux-musl, x86-netbsd-none, x86-openbsd-none, x86-windows-gnu, x86_64-freebsd-none, x86_64-linux-gnu, x86_64-linux-gnux32, x86_64-linux-musl, x86_64-linux-muslx32, x86_64-maccatalyst-none, x86_64-macos-none, x86_64-netbsd-none, x86_64-openbsd-none, x86_64-windows-gnu]
steps:
- name: Checkout
uses: actions/checkout@main
with:
path: ${{ github.workspace }}
submodules: true
- name: Setup Zig
uses: mlugg/setup-zig@main
with:
version: "0.17.0-dev.304+9787df942"
use-cache: false
- name: Setup Zig Toolchain
shell: bash
run: git clone https://github.com/HomuHomu833/zig-as-llvm ${{ github.workspace }}/zig-as-llvm
- name: Build Webify
shell: bash
run: |
TOOLCHAIN=${{ github.workspace }}/zig-as-llvm
if [[ "$ZIG_TARGET" != *"-macos-"* ]]; then
STATIC_FLAG="-static"
fi
JOBS=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo "${NUMBER_OF_PROCESSORS:-4}")
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_C_FLAGS="${STATIC_FLAG} -D_LARGEFILE64_SOURCE=1" \
-DCMAKE_CXX_FLAGS="${STATIC_FLAG} -D_LARGEFILE64_SOURCE=1" \
-DCMAKE_EXE_LINKER_FLAGS="${STATIC_FLAG}" \
-DCMAKE_C_COMPILER="${TOOLCHAIN}/bin/cc" \
-DCMAKE_CXX_COMPILER="${TOOLCHAIN}/bin/c++" \
-DCMAKE_ASM_COMPILER="${TOOLCHAIN}/bin/cc" \
-DCMAKE_LINKER="${TOOLCHAIN}/bin/ld" \
-DCMAKE_OBJCOPY="${TOOLCHAIN}/bin/objcopy" \
-DCMAKE_AR="${TOOLCHAIN}/bin/ar" \
-DCMAKE_RANLIB="${TOOLCHAIN}/bin/ranlib" \
-DCMAKE_STRIP="${TOOLCHAIN}/bin/strip" \
-DCMAKE_RC_COMPILER="${TOOLCHAIN}/bin/rc"
cmake --build . --config MinSizeRel -j"${JOBS}"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: webify-${{ matrix.target }}
path: build/webify*
if-no-files-found: error