diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dda10f1..c84166b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,11 +37,14 @@ jobs: - name: Compile wrapper on Linux / macOS if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') run: | - mkdir tmp-build - cd tmp-build - cmake $GITHUB_WORKSPACE/pythonfmu3/pythonfmu-export -DCMAKE_BUILD_TYPE=Release - cmake --build . --config Release - cd .. + docker build -f DockerFile -t pythonfmu3-wrapper --target build . + + - name: Create container and copy out artifact + if : startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') + run: | + docker create --name extract pythonfmu3-wrapper + docker cp extract:/io/pythonfmu3/resources $GITHUB_WORKSPACE/pythonfmu3 + docker rm extract - name: Archive wrapper library uses: actions/upload-artifact@v4 diff --git a/DockerFile b/DockerFile new file mode 100644 index 0000000..c8e959b --- /dev/null +++ b/DockerFile @@ -0,0 +1,20 @@ +FROM quay.io/pypa/manylinux_2_28_x86_64 AS build + +RUN yum install -y \ + cmake \ + gcc \ + gcc-c++ \ + make \ + git \ + python3 \ + python3-pip \ + python3-devel + +WORKDIR /io + +COPY . . + +WORKDIR /io/tmp-build + +RUN cmake /io/pythonfmu3/pythonfmu-export -DCMAKE_BUILD_TYPE=Release \ + && cmake --build . --config Release \ No newline at end of file diff --git a/pythonfmu3/pythonfmu-export/CMakeLists.txt b/pythonfmu3/pythonfmu-export/CMakeLists.txt index 25222d4..8b48b84 100644 --- a/pythonfmu3/pythonfmu-export/CMakeLists.txt +++ b/pythonfmu3/pythonfmu-export/CMakeLists.txt @@ -35,7 +35,7 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Force to use stable Python ABI https://docs.python.org/3/c-api/stable.html add_compile_definitions(Py_LIMITED_API) -find_package(Python3 REQUIRED COMPONENTS Interpreter Development) +find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module) if (WIN32) set(Python3_LIBRARIES ${Python3_LIBRARY_DIRS}/python3.lib) endif ()