Skip to content

Merge branch 'develop' into build-linux #48

Merge branch 'develop' into build-linux

Merge branch 'develop' into build-linux #48

Workflow file for this run

name: Build
on:
push:
paths:
- xmake.lua
- src/**
- patch/**
- third-party/**
- .github/workflows/build.yml
pull_request:
paths:
- xmake.lua
- src/**
- patch/**
- third-party/**
- .github/workflows/build.yml
workflow_dispatch:
env:
EndStoneVersion: "v0.5.6"
EndStoneSDKPath: "build/_deps/endstone-src"
LLVM_VERSION: 15
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022]
name: Build with ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout EndStone repo
uses: actions/checkout@v4
with:
repository: EndstoneMC/endstone
ref: ${{ env.EndStoneVersion }}
path: ${{ env.EndStoneSDKPath }}
fetch-depth: 0
- uses: actions/cache@v4
with:
path: |
~/AppData/Local/.xmake
key: xmake-${{ hashFiles('xmake.lua') }}
restore-keys: |
xmake-
- name: Apply Patch
run: |
cd ${{ env.EndStoneSDKPath }}
git apply "${{ github.workspace }}/patch/cxx20.patch"
- name: Apply Patch(Linux)
run: |
cd ${{ env.EndStoneSDKPath }}
git apply "${{ github.workspace }}/patch/linux.patch"
- uses: xmake-io/github-action-setup-xmake@v1
# with:
# xmake-version: branch@master
- name: Set up Cland(Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update -y -q
sudo apt-get install -y -q lsb-release wget software-properties-common gnupg
sudo wget https://apt.llvm.org/llvm.sh
sudo chmod +x llvm.sh
sudo ./llvm.sh ${{env.LLVM_VERSION}}
sudo apt-get install -y -q libc++-${{env.LLVM_VERSION}}-dev libc++abi-${{env.LLVM_VERSION}}-dev
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${{env.LLVM_VERSION}} 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${{env.LLVM_VERSION}} 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{env.LLVM_VERSION}} 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{env.LLVM_VERSION}} 100
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-${{env.LLVM_VERSION}} 100
sudo update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-${{env.LLVM_VERSION}} 100
- run: |
xmake repo -u
- run: |
xmake f -a x64 -m release -v -y
- run: |
xmake -v -y
- uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ matrix.os }}-x64-${{ github.sha }}
path: |
bin/