mirror of
https://github.com/alterware/master-server.git
synced 2025-04-20 12:25:42 +00:00
feat: arm64 Linux Docker image
This commit is contained in:
parent
b927f4aa01
commit
75d6440776
100
.github/workflows/build.yml
vendored
100
.github/workflows/build.yml
vendored
@ -19,7 +19,7 @@ env:
|
|||||||
PREMAKE_VERSION: "5.0.0-beta6"
|
PREMAKE_VERSION: "5.0.0-beta6"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-win:
|
build-windows:
|
||||||
name: Build Windows
|
name: Build Windows
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
@ -48,7 +48,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# NOTE - If LFS ever starts getting used during builds, switch this to true!
|
|
||||||
lfs: false
|
lfs: false
|
||||||
|
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
@ -93,7 +92,7 @@ jobs:
|
|||||||
- release
|
- release
|
||||||
arch:
|
arch:
|
||||||
- x86
|
- x86
|
||||||
- x64
|
- amd64
|
||||||
steps:
|
steps:
|
||||||
- name: Install g++ and multilib
|
- name: Install g++ and multilib
|
||||||
run: |
|
run: |
|
||||||
@ -109,7 +108,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# NOTE - If LFS ever starts getting used during builds, switch this to true!
|
|
||||||
lfs: false
|
lfs: false
|
||||||
|
|
||||||
- name: Install dependencies (x86)
|
- name: Install dependencies (x86)
|
||||||
@ -146,6 +144,86 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master
|
build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master
|
||||||
|
|
||||||
|
prebuild-linux-arm64:
|
||||||
|
name: Prebuild Linux
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out files
|
||||||
|
uses: actions/checkout@main
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
fetch-depth: 0
|
||||||
|
lfs: false
|
||||||
|
|
||||||
|
- name: Install Premake5
|
||||||
|
uses: diamante0018/setup-premake@master
|
||||||
|
with:
|
||||||
|
version: ${{ env.PREMAKE_VERSION }}
|
||||||
|
|
||||||
|
- name: Generate project files
|
||||||
|
run: premake5 --cc=clang gmake
|
||||||
|
|
||||||
|
- name: Upload project files
|
||||||
|
uses: actions/upload-artifact@main
|
||||||
|
with:
|
||||||
|
name: linux-project-files
|
||||||
|
path: |
|
||||||
|
build/
|
||||||
|
|
||||||
|
build-linux-arm64:
|
||||||
|
name: Build Linux
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs: prebuild-linux-arm64
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
configuration:
|
||||||
|
- debug
|
||||||
|
- release
|
||||||
|
arch:
|
||||||
|
- arm64
|
||||||
|
include:
|
||||||
|
- arch: arm64
|
||||||
|
os: ubuntu-24.04-arm
|
||||||
|
steps:
|
||||||
|
- name: Check out files
|
||||||
|
uses: actions/checkout@main
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
fetch-depth: 0
|
||||||
|
lfs: false
|
||||||
|
|
||||||
|
- name: Compress the build directory
|
||||||
|
run: mkdir -p build
|
||||||
|
|
||||||
|
- name: Download project files
|
||||||
|
uses: actions/download-artifact@main
|
||||||
|
with:
|
||||||
|
name: linux-project-files
|
||||||
|
path: build/
|
||||||
|
|
||||||
|
- name: Install LLVM
|
||||||
|
run: |
|
||||||
|
wget https://apt.llvm.org/llvm.sh
|
||||||
|
chmod +x llvm.sh
|
||||||
|
sudo ./llvm.sh 18
|
||||||
|
|
||||||
|
- name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
pushd build
|
||||||
|
make config=${{matrix.configuration}}_${{matrix.arch}} -j$(nproc)
|
||||||
|
env:
|
||||||
|
CC: clang-18
|
||||||
|
CXX: clang++-18
|
||||||
|
|
||||||
|
- name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
|
||||||
|
uses: actions/upload-artifact@main
|
||||||
|
with:
|
||||||
|
name: linux-${{matrix.arch}}-${{matrix.configuration}}
|
||||||
|
path: |
|
||||||
|
build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
name: Build macOS
|
name: Build macOS
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
@ -156,7 +234,7 @@ jobs:
|
|||||||
- debug
|
- debug
|
||||||
- release
|
- release
|
||||||
arch:
|
arch:
|
||||||
- x64
|
- amd64
|
||||||
- arm64
|
- arm64
|
||||||
steps:
|
steps:
|
||||||
- name: Check out files
|
- name: Check out files
|
||||||
@ -164,7 +242,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# NOTE - If LFS ever starts getting used during builds, switch this to true!
|
|
||||||
lfs: false
|
lfs: false
|
||||||
|
|
||||||
- name: Install Premake5
|
- name: Install Premake5
|
||||||
@ -192,7 +269,7 @@ jobs:
|
|||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy artifacts
|
name: Deploy artifacts
|
||||||
needs: [build-win, build-linux, build-macos]
|
needs: [build-windows, build-linux, build-linux-arm64, build-macos]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.ref_type == 'tag'
|
if: github.ref_type == 'tag'
|
||||||
steps:
|
steps:
|
||||||
@ -202,7 +279,7 @@ jobs:
|
|||||||
- name: Download Release binaries
|
- name: Download Release binaries
|
||||||
uses: actions/download-artifact@main
|
uses: actions/download-artifact@main
|
||||||
with:
|
with:
|
||||||
name: linux-x64-release
|
name: linux-amd64-release
|
||||||
|
|
||||||
- name: Install SSH key
|
- name: Install SSH key
|
||||||
uses: shimataro/ssh-key-action@v2.7.0
|
uses: shimataro/ssh-key-action@v2.7.0
|
||||||
@ -221,7 +298,7 @@ jobs:
|
|||||||
|
|
||||||
docker:
|
docker:
|
||||||
name: Create Docker Image
|
name: Create Docker Image
|
||||||
needs: [build-win, build-linux, build-macos]
|
needs: [build-windows, build-linux, build-linux-arm64, build-macos]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.ref_type == 'tag'
|
if: github.ref_type == 'tag'
|
||||||
steps:
|
steps:
|
||||||
@ -247,6 +324,9 @@ jobs:
|
|||||||
done
|
done
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Setup QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3.6.0
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3.10.0
|
uses: docker/setup-buildx-action@v3.10.0
|
||||||
|
|
||||||
@ -270,7 +350,7 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6.15.0
|
uses: docker/build-push-action@v6.15.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
FROM ubuntu:latest
|
FROM ubuntu:noble
|
||||||
|
ARG TARGETARCH
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get install -y libc++-dev
|
|
||||||
|
|
||||||
WORKDIR /master-server
|
WORKDIR /master-server
|
||||||
|
|
||||||
@ -11,7 +9,7 @@ RUN mkdir -p /master-server && \
|
|||||||
chown alterware-master:alterware-master /master-server && \
|
chown alterware-master:alterware-master /master-server && \
|
||||||
chmod 775 /master-server
|
chmod 775 /master-server
|
||||||
|
|
||||||
COPY --chown=alterware-master:alterware-master --chmod=755 ./linux-x64-release/alterware-master /master-server
|
COPY --chown=alterware-master:alterware-master --chmod=755 ./linux-${TARGETARCH}-release/alterware-master /master-server
|
||||||
|
|
||||||
USER alterware-master
|
USER alterware-master
|
||||||
|
|
||||||
|
2
deps/premake/libtomcrypt.lua
vendored
2
deps/premake/libtomcrypt.lua
vendored
@ -60,7 +60,7 @@ function libtomcrypt.project()
|
|||||||
buildoptions "-mcpu=apple-m1"
|
buildoptions "-mcpu=apple-m1"
|
||||||
filter {}
|
filter {}
|
||||||
|
|
||||||
filter { "system:macosx", "platforms:x64" }
|
filter { "system:macosx", "platforms:amd64" }
|
||||||
buildoptions "-mcpu=x86-64"
|
buildoptions "-mcpu=x86-64"
|
||||||
filter {}
|
filter {}
|
||||||
|
|
||||||
|
15
premake5.lua
15
premake5.lua
@ -41,8 +41,10 @@ configurations {"debug", "release"}
|
|||||||
language "C++"
|
language "C++"
|
||||||
cppdialect "C++20"
|
cppdialect "C++20"
|
||||||
|
|
||||||
if os.istarget("darwin") then
|
if os.istarget("linux") then
|
||||||
platforms {"x64", "arm64"}
|
platforms {"x86", "amd64", "arm64"}
|
||||||
|
elseif os.istarget("macosx") then
|
||||||
|
platforms {"amd64", "arm64"}
|
||||||
else
|
else
|
||||||
platforms {"x86", "x64", "arm64"}
|
platforms {"x86", "x64", "arm64"}
|
||||||
end
|
end
|
||||||
@ -55,6 +57,10 @@ filter "platforms:x64"
|
|||||||
architecture "x86_64"
|
architecture "x86_64"
|
||||||
filter {}
|
filter {}
|
||||||
|
|
||||||
|
filter "platforms:amd64"
|
||||||
|
architecture "x86_64"
|
||||||
|
filter {}
|
||||||
|
|
||||||
filter "platforms:arm64"
|
filter "platforms:arm64"
|
||||||
architecture "ARM64"
|
architecture "ARM64"
|
||||||
filter {}
|
filter {}
|
||||||
@ -77,15 +83,12 @@ if os.istarget("linux") then
|
|||||||
filter {}
|
filter {}
|
||||||
|
|
||||||
filter { "toolset:clang*" }
|
filter { "toolset:clang*" }
|
||||||
buildoptions "-stdlib=libc++"
|
|
||||||
linkoptions "-stdlib=libc++"
|
|
||||||
|
|
||||||
-- always try to use lld. LD or Gold will not work
|
-- always try to use lld. LD or Gold will not work
|
||||||
linkoptions "-fuse-ld=lld"
|
linkoptions "-fuse-ld=lld"
|
||||||
filter {}
|
filter {}
|
||||||
end
|
end
|
||||||
|
|
||||||
filter { "system:macosx", "platforms:x64" }
|
filter { "system:macosx", "platforms:amd64" }
|
||||||
buildoptions "-arch x86_64"
|
buildoptions "-arch x86_64"
|
||||||
linkoptions "-arch x86_64"
|
linkoptions "-arch x86_64"
|
||||||
filter {}
|
filter {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user