Compare commits

..

4 Commits

Author SHA1 Message Date
William Bell
b905026010 fix rosetta not used 2025-08-16 04:31:21 +01:00
William Bell
677afd9433 fix using Rosetta 2025-08-16 04:10:57 +01:00
William Bell
757da3f973 stupid ai 2025-08-16 03:51:05 +01:00
William Bell
5a86510c3b fix release for macos x86_64 and arm64 2025-08-16 03:48:48 +01:00

View File

@@ -12,21 +12,13 @@ on:
jobs: jobs:
build-linux: build-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64, arm64]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- name: Install build tools - name: Install build tools
run: | run: sudo apt-get update && sudo apt-get install -y flex bison
sudo apt-get update
sudo apt-get install -y flex bison make cmake build-essential
if [ "${{ matrix.arch }}" = "arm64" ]; then
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
fi
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
@@ -41,28 +33,17 @@ jobs:
- name: Build - name: Build
run: | run: |
BUILD_DIR="build_${{ matrix.arch }}" conan install . --build=missing
mkdir -p "$BUILD_DIR" conan build .
cd "$BUILD_DIR"
if [ "${{ matrix.arch }}" = "arm64" ]; then
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
fi
conan install .. --build=missing
conan build ..
cd ..
- name: Package - name: Package
run: | run: |
TAG=${GITHUB_REF##refs/tags/} TAG=${GITHUB_REF##refs/tags/}
OS="linux" OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH="${{ matrix.arch }}" ARCH=$(uname -m)
FOLDER="chloride-$TAG-$OS-$ARCH" FOLDER="chloride-$TAG-$OS-$ARCH"
TAR="$FOLDER.tar.gz" TAR="$FOLDER.tar.gz"
mv build_${ARCH}/bin "$FOLDER" mv build/bin "$FOLDER"
cp LICENSE.txt "$FOLDER" cp LICENSE.txt "$FOLDER"
tar -czf "$TAR" "$FOLDER" tar -czf "$TAR" "$FOLDER"
echo "TAR_NAME=$TAR" >> $GITHUB_ENV echo "TAR_NAME=$TAR" >> $GITHUB_ENV
@@ -70,7 +51,7 @@ jobs:
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: linux-${{ matrix.arch }}-artifact name: linux-artifact
path: ${{ env.TAR_NAME }} path: ${{ env.TAR_NAME }}
build-macos: build-macos:
@@ -95,22 +76,30 @@ jobs:
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install conan pip install conan
conan profile detect if [ "${{ matrix.arch }}" = "x86_64" ] && [ "$(uname -m)" = "arm64" ]; then
arch -x86_64 conan profile detect
else
conan profile detect
fi
- name: Build - name: Build
run: | run: |
# Create a build directory per arch
BUILD_DIR="build_${{ matrix.arch }}" BUILD_DIR="build_${{ matrix.arch }}"
mkdir -p "$BUILD_DIR" mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR" cd "$BUILD_DIR"
# Use the matrix architecture for the build # Use Rosetta for x86_64 builds on Apple Silicon
export CFLAGS="-arch ${{ matrix.arch }}" if [ "${{ matrix.arch }}" = "x86_64" ] && [ "$(uname -m)" = "arm64" ]; then
export CXXFLAGS="-arch ${{ matrix.arch }}" arch -x86_64 bash -c "
export LDFLAGS="-arch ${{ matrix.arch }}" export CMAKE_OSX_ARCHITECTURES=x86_64
conan install .. --build=missing
conan install .. --build=missing conan build ..
conan build .. "
else
export CMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}"
conan install .. --build=missing
conan build ..
fi
cd .. cd ..
@@ -121,7 +110,7 @@ jobs:
ARCH="${{ matrix.arch }}" ARCH="${{ matrix.arch }}"
FOLDER="chloride-$TAG-$OS-$ARCH" FOLDER="chloride-$TAG-$OS-$ARCH"
TAR="$FOLDER.tar.gz" TAR="$FOLDER.tar.gz"
mv build_${ARCH}/bin "$FOLDER" mv build/bin "$FOLDER"
cp LICENSE.txt "$FOLDER" cp LICENSE.txt "$FOLDER"
tar -czf "$TAR" "$FOLDER" tar -czf "$TAR" "$FOLDER"
echo "TAR_NAME=$TAR" >> $GITHUB_ENV echo "TAR_NAME=$TAR" >> $GITHUB_ENV
@@ -134,9 +123,6 @@ jobs:
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
strategy:
matrix:
arch: [x86_64, arm64]
defaults: defaults:
run: run:
shell: msys2 {0} shell: msys2 {0}
@@ -146,8 +132,7 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: Setup MSYS2 - uses: msys2/setup-msys2@v2
uses: msys2/setup-msys2@v2
with: with:
msystem: MINGW64 msystem: MINGW64
update: true update: true
@@ -168,37 +153,25 @@ jobs:
- name: Build Project - name: Build Project
run: | run: |
BUILD_DIR="build_${{ matrix.arch }}" conan install . --profile mingw-profile.txt --build=missing
mkdir -p "$BUILD_DIR" conan build . --profile mingw-profile.txt
cd "$BUILD_DIR"
if [ "${{ matrix.arch }}" = "arm64" ]; then
# Use the ARM64 cross-compiler
export CC=aarch64-w64-mingw32-gcc
export CXX=aarch64-w64-mingw32-g++
fi
conan install .. --profile mingw-profile.txt --build=missing
conan build .. --profile mingw-profile.txt
cd ..
- name: Package - name: Package
run: | run: |
TAG=${GITHUB_REF##refs/tags/} TAG=${GITHUB_REF##refs/tags/}
OS="windows" OS="windows"
ARCH="${{ matrix.arch }}" ARCH=$(uname -m)
FOLDER="chloride-$TAG-$OS-$ARCH" FOLDER="chloride-$TAG-$OS-$ARCH"
ZIP="$FOLDER.zip" TAR="$FOLDER.tar.gz"
mv build_${ARCH}/bin "$FOLDER" mv build/bin "$FOLDER"
cp LICENSE.txt "$FOLDER" cp LICENSE.txt "$FOLDER"
powershell Compress-Archive -Path "$FOLDER" -DestinationPath "$ZIP" tar -czf "$TAR" "$FOLDER"
echo "TAR_NAME=$ZIP" >> $GITHUB_ENV echo "TAR_NAME=$TAR" >> $GITHUB_ENV
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: windows-${{ matrix.arch }}-artifact name: windows-artifact
path: ${{ env.TAR_NAME }} path: ${{ env.TAR_NAME }}
release: release: