change to cross compile linux
This commit is contained in:
65
.github/workflows/release.yml
vendored
65
.github/workflows/release.yml
vendored
@@ -10,8 +10,11 @@ on:
|
|||||||
- '*' # Any tag
|
- '*' # Any tag
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux-x86_64:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: [x86_64, arm64] # build both architectures
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@@ -33,8 +36,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
conan install . --build=missing
|
if [ "${{ matrix.arch }}" = "x86_64" ]; then
|
||||||
conan build .
|
conan install . --build=missing
|
||||||
|
conan build .
|
||||||
|
else
|
||||||
|
sudo apt-get install -y aarch64-linux-gnu-gcc
|
||||||
|
conan install . --profile linux-arm-profile.txt --build=missing
|
||||||
|
conan build . --profile linux-arm-profile.txt
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
@@ -54,50 +63,6 @@ jobs:
|
|||||||
name: linux-${{ matrix.arch }}-artifact
|
name: linux-${{ matrix.arch }}-artifact
|
||||||
path: ${{ env.TAR_NAME }}
|
path: ${{ env.TAR_NAME }}
|
||||||
|
|
||||||
build-linux-arm64:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Run build in arm64 container
|
|
||||||
run: |
|
|
||||||
docker run --rm --platform linux/arm64 \
|
|
||||||
-v $PWD:/work -w /work \
|
|
||||||
ubuntu:latest \
|
|
||||||
bash -c "
|
|
||||||
apt-get update && apt-get install -y python3-pip gcc flex bison cmake make &&
|
|
||||||
pip install --break-system-packages conan &&
|
|
||||||
conan profile detect --force &&
|
|
||||||
conan install . --build=missing &&
|
|
||||||
conan build .
|
|
||||||
"
|
|
||||||
|
|
||||||
- name: Package
|
|
||||||
run: |
|
|
||||||
TAG=${GITHUB_REF##refs/tags/}
|
|
||||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
||||||
ARCH=arm64
|
|
||||||
FOLDER="chloride-$TAG-$OS-$ARCH"
|
|
||||||
TAR="$FOLDER.tar.gz"
|
|
||||||
mv build/bin "$FOLDER"
|
|
||||||
cp LICENSE.txt "$FOLDER"
|
|
||||||
tar -czf "$TAR" "$FOLDER"
|
|
||||||
echo "TAR_NAME=$TAR" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: linux-${{ matrix.arch }}-artifact
|
|
||||||
path: ${{ env.TAR_NAME }}
|
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
strategy:
|
strategy:
|
||||||
@@ -197,8 +162,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Project
|
- name: Build Project
|
||||||
run: |
|
run: |
|
||||||
conan install . --profile mingw-profile.txt --build=missing
|
conan install . --profile windows-profile.txt --build=missing
|
||||||
conan build . --profile mingw-profile.txt
|
conan build . --profile windows-profile.txt
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
@@ -220,7 +185,7 @@ jobs:
|
|||||||
|
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build-linux-x86_64, build-linux-arm64, build-macos, build-windows]
|
needs: [build-linux, build-macos, build-windows]
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
|||||||
15
linux-arm-profile.txt
Normal file
15
linux-arm-profile.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[settings]
|
||||||
|
os=Linux
|
||||||
|
arch=armv8
|
||||||
|
compiler=gcc
|
||||||
|
compiler.version=12
|
||||||
|
compiler.libcxx=libstdc++11
|
||||||
|
build_type=Release
|
||||||
|
|
||||||
|
[env]
|
||||||
|
CC=aarch64-linux-gnu-gcc
|
||||||
|
CXX=aarch64-linux-gnu-g++
|
||||||
|
AR=aarch64-linux-gnu-ar
|
||||||
|
RANLIB=aarch64-linux-gnu-ranlib
|
||||||
|
LD=aarch64-linux-gnu-ld
|
||||||
|
STRIP=aarch64-linux-gnu-strip
|
||||||
Reference in New Issue
Block a user