From 35fff80d18628d07c5e19c67b1a8bc0c88f47828 Mon Sep 17 00:00:00 2001 From: Johnny Date: Mon, 10 Feb 2025 00:58:03 +0100 Subject: [PATCH 1/4] Update ci.yml --- .github/workflows/ci.yml | 149 ++++++++++++++++++++++++--------------- 1 file changed, 92 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94c0b43..f34964c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,72 +1,107 @@ -name: CI +name: Multi-Arch CI on: push: - branches: - - master + branches: ["master"] pull_request: - branches: - - master + branches: ["master"] jobs: - build: - strategy: - matrix: - os: [ubuntu-22.04, macos-12, macos-14, windows-2022] + build: + name: Build (OS=${{ matrix.os }}, Arch=${{ matrix.arch }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-24.04, ubuntu-22.04, macos-15 ] + arch: [ x86_64 ] + include: + - os: ubuntu-24.04-arm + arch: aarch64 + - os: ubuntu-22.04-arm + arch: aarch64 + - os: macos-15 + arch: arm64 + - os: windows-2025 + arch: amd64 - runs-on: ${{ matrix.os }} + steps: + - name: Checkout code + uses: actions/checkout@v4 - steps: - - uses: actions/checkout@v4 + ##################################### + # Dependencies Installation (Optional) + ##################################### - - name: Install ninja - shell: bash - run: | - if [[ "${{ runner.os }}" == "macOS" ]]; then - brew install ninja - elif [[ "${{ runner.os }}" == "Linux" ]]; then - sudo apt-get -y update - sudo apt-get -y install ninja-build - fi + # Linux dependencies + - name: Install dependencies (Linux) + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get update + sudo apt-get install -y build-essential ninja-build cmake git + # If you need system LLVM for something else: + # sudo apt-get install -y clang lld llvm-dev libclang-dev - - name: Build - if: matrix.os != 'windows-2022' - run: | - cmake -Bbuild -S. -GNinja - ninja -Cbuild + # macOS dependencies + - name: Install dependencies (macOS) + if: startsWith(matrix.os, 'macos') + run: | + brew update + brew install ninja cmake git - - name: Build - if: matrix.os == 'windows-2022' - shell: cmd - run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cmake -Bbuild -S. -GNinja - ninja -Cbuild + # Windows dependencies + - name: Install dependencies (Windows) + if: startsWith(matrix.os, 'windows') + shell: pwsh + run: | + choco install ninja cmake git -y + - name: Setup MSBuild (Windows) + if: startsWith(matrix.os, 'windows') + uses: microsoft/setup-msbuild@v2 - - name: Test - run: | - cd build/castxml-prefix/src/castxml-build - ctest --output-on-failure + ##################################### + # Configure the Superbuild + ##################################### + - name: Configure + run: | + cmake -B build -S . -GNinja -DCMAKE_BUILD_TYPE=Release + shell: bash - - name: Create archive for Windows - if: matrix.os == 'windows-2022' - shell: cmd - run: | - cd build - 7z a castxml-${{ matrix.os }}.zip castxml - move castxml-${{ matrix.os }}.zip .. + ##################################### + # Build the Superbuild + ##################################### + - name: Build + run: cmake --build build --config Release - - name: Create archive for macOS and Ubuntu - if: matrix.os != 'windows-2022' - shell: bash - run: | - cd build - tar cvf castxml-${{ matrix.os }}.tar castxml - gzip -9 castxml-${{ matrix.os }}.tar - mv castxml-${{ matrix.os }}.tar.gz .. + ##################################### + # [Optional] Run Tests + ##################################### + - name: Test + run: | + cd build/castxml-prefix/src/castxml-build + ctest --output-on-failure - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.os }}-archive - path: ./castxml-${{ matrix.os }}.* + ##################################### + # Package the resulting castxml binary + ##################################### + - name: Create Artifact (Windows) + if: startsWith(matrix.os, 'windows') + shell: cmd + run: | + cd build\castxml\bin + 7z a ..\..\castxml-${{ matrix.os }}-${{ matrix.arch }}.zip castxml.exe + + - name: Create Artifact (Non-Windows) + if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos') + shell: bash + run: | + cd build/castxml/bin + tar czvf ../../castxml-${{ matrix.os }}-${{ matrix.arch }}.tar.gz castxml + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: castxml-${{ matrix.os }}-${{ matrix.arch }} + path: | + build/castxml-*.tar.gz + build/castxml-*.zip From cadaa833f4f04b5ba774e19780899757157ceb92 Mon Sep 17 00:00:00 2001 From: Johnny Date: Mon, 10 Feb 2025 01:03:15 +0100 Subject: [PATCH 2/4] Update manylinux-build.sh --- manylinux-build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manylinux-build.sh b/manylinux-build.sh index 726ecd5..83b7ea4 100755 --- a/manylinux-build.sh +++ b/manylinux-build.sh @@ -3,10 +3,10 @@ set -e -x -o pipefail -dockcross_version=20240404-2c6c0a5 +dockcross_version=20250109-7bf589c -podman pull docker.io/dockcross/manylinux2014-x64:$dockcross_version -podman run --rm docker.io/dockcross/manylinux2014-x64:$dockcross_version > ./dockcross-x64 +podman pull docker.io/dockcross/manylinux_2_28-x64:$dockcross_version +podman run --rm docker.io/dockcross/manylinux_2_28-x64:$dockcross_version > ./dockcross-x64 chmod +x ./dockcross-x64 ./dockcross-x64 cmake -Bbuild -S. -GNinja @@ -19,7 +19,7 @@ popd rm -rf build -manylinux_version=2024-04-02-96b33b9 +manylinux_version=2025.01.24-1 cat << EOF @@ -32,5 +32,5 @@ once before running the following commands on an amd64 system. EOF -podman pull quay.io/pypa/manylinux2014_aarch64:$manylinux_version -podman run -it --rm -v $(pwd):/work quay.io/pypa/manylinux2014_aarch64:$manylinux_version /work/manylinux-internal.sh +podman pull quay.io/pypa/manylinux_2_28_aarch64:$manylinux_version +podman run -it --rm -v $(pwd):/work quay.io/pypa/manylinux_2_28_aarch64:$manylinux_version /work/manylinux-internal.sh From dbe6394bbc04a07454618874b496aa03af73637f Mon Sep 17 00:00:00 2001 From: Johnny Date: Mon, 10 Feb 2025 01:04:31 +0100 Subject: [PATCH 3/4] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26d185f..cbe5a0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME MATCHES "Linux") set(linux_args "-DCMAKE_CXX_FLAGS:STRING=-static-libstdc++") endif() # 2024-04-12 master -set(CastXML_GIT_TAG v0.6.5 CACHE STRING "CastXML Git revision.") +set(CastXML_GIT_TAG v0.6.10 CACHE STRING "CastXML Git revision.") ExternalProject_Add(castxml GIT_REPOSITORY https://github.com/CastXML/CastXML.git GIT_TAG ${CastXML_GIT_TAG} From 8fc741315c394ddb1349f8103747d78171d7a6f4 Mon Sep 17 00:00:00 2001 From: Johnny Date: Mon, 10 Feb 2025 16:37:34 +0100 Subject: [PATCH 4/4] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbe5a0b..3fc4670 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME MATCHES "Linux") set(linux_args "-DCMAKE_CXX_FLAGS:STRING=-static-libstdc++") endif() # 2024-04-12 master -set(CastXML_GIT_TAG v0.6.10 CACHE STRING "CastXML Git revision.") +set(CastXML_GIT_TAG v0.6.11 CACHE STRING "CastXML Git revision.") ExternalProject_Add(castxml GIT_REPOSITORY https://github.com/CastXML/CastXML.git GIT_TAG ${CastXML_GIT_TAG}