Skip to content

Commit

Permalink
feat: try to setup multiarch builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
epicbigcat committed Dec 7, 2024
1 parent a4ef3fb commit 8c59d0a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,39 @@ jobs:
strategy:
matrix:
mode: [release, debug]
runs-on: ubuntu-20.04 # for compatibility.
arch: [x86_64, arm64-v8a, mips64, mips64el]
runs-on: ubuntu-20.04 # for compatibility. todo: remove it
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup XMake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@dev

- name: Restore xmake cache
uses: actions/cache@v4
with:
path: |
~/.xmake
key: xmake-linux-${{ hashFiles('xmake.lua') }}
~/.cache/zig
key: xmake-linux-${{ matrix.arch }}-${{ hashFiles('xmake.lua') }}
restore-keys: |
xmake-linux-${{ matrix.mode }}-
xmake-linux-${{ matrix.arch }}-${{ matrix.mode }}-
- name: Sync with repository
run: |
xmake repo -u
- name: Build for host
run: |
xmake f -a x86_64 -m ${{ matrix.mode }} -p linux -v -y
xmake f -a ${{ matrix.arch }} -m ${{ matrix.mode }} -p linux -v -y
xmake -v -y
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: allay-launcher-linux-x86_64-${{ matrix.mode }}
name: allay-launcher-linux-${{ matrix.arch }}-${{ matrix.mode }}
path: |
build/linux/x86_64/${{ matrix.mode }}
build/linux/${{ matrix.arch }}/${{ matrix.mode }}
16 changes: 7 additions & 9 deletions xmake.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
add_rules('mode.debug', 'mode.release')

add_repositories('allaymc-repo https://github.com/AllayMC/xmake-repo.git')

add_requires('openssl', {system = true})
if is_plat('linux') then
set_toolchains('zig')
add_requireconfs('**', { system = false })
end

add_requires('argparse 3.1')
add_requires('spdlog 1.14.1')
add_requires('nlohmann_json 3.11.3')
add_requires('cpr 1.11.0')
add_requires('cpr 1.11.1')

target('allay')
set_kind('binary')
Expand All @@ -28,15 +29,12 @@ target('allay')
add_cxflags('/utf-8')

remove_files('src/**_linux.*')
else
add_linkgroups('cpr', 'curl', 'ssl', 'crypto', {static = true})
add_links('dl')

else
remove_files('src/**_win32.*')
end

set_languages('c++17')
set_optimize('smallest')
set_optimize('fastest')

set_pcxxheader('src/pch.h')

Expand Down

0 comments on commit 8c59d0a

Please sign in to comment.