[DOC] Add explanation of using xmake. #110
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 pipeline for building Hashlink | |
on: | |
push: | |
branches: [ main ] | |
# Tips for Linux | |
# | |
# We build the system on Ubuntu (but not SteamRT). This is because | |
# none of the compilers with SteamRT can correctly compile | |
# libuv (builtin 4.8.8 - no stdatomic.h, clang 3.6/3.8 and gcc-9 stuck | |
# at compilation. | |
# | |
# For a purpose of maximizing compatibility, we maintain our | |
# dependencies as much as possible. | |
# | |
# Inc case we use updated SteamRT in the future, We can use | |
# addnab/docker-run-action@v3 job to run commnds in container. | |
# REF: https://aschmelyun.com/blog/using-docker-run-inside-of-github-actions/ | |
# | |
# NOTE for xmake: We can't default xmake ppa because Steam Runtime | |
# defines its own /etc/lsb-release to SteamRT. We have to build it | |
# from source. | |
jobs: | |
build_linux_x86_64_general: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout build scripts | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Install xmake tool | |
run: | | |
mkdir ./xmake-build/ | |
git clone https://github.com/xmake-io/xmake | |
cd ./xmake | |
git submodule update --init --recursive . | |
./configure --prefix=../xmake-build | |
make | |
make install | |
- name: Checkout hashlink code base | |
run: | | |
bash clone-code.sh | |
- name: Fake glu.h | |
run: | | |
mkdir -p hashlink/ci_fix/GL | |
cp ci_fix/glu.h hashlink/ci_fix/GL/glu.h | |
- name: Build Linux (x86_64) | |
run: | | |
./xmake-build/bin/xmake global --yes --theme=plain | |
./xmake-build/bin/xmake config --yes -a x86_64 -p linux | |
./xmake-build/bin/xmake build --yes libhl | |
./xmake-build/bin/xmake build --yes hl | |
./xmake-build/bin/xmake build --yes fmt | |
./xmake-build/bin/xmake build --yes sqlite | |
./xmake-build/bin/xmake build --yes ssl | |
./xmake-build/bin/xmake build --yes ui | |
./xmake-build/bin/xmake build --yes sdl | |
./xmake-build/bin/xmake build --yes openal | |
./xmake-build/bin/xmake build --yes uv | |
- name: Create package (x86_64) | |
run: | | |
./xmake-build/bin/xmake install -o ./package --all | |
rm -rf ./package/bin ./package/include | |
mv ./package/lib/* ./package/ | |
mv ./package/libopenal.* ./package/lib/ |