diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d289a6c9e..f846c5898 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - file: ./Dockerfile + file: ./CI/Dockerfile platforms: linux/amd64 tags: lib3mf_ubi8:latest load: true @@ -51,14 +51,14 @@ jobs: id: extract with: image: lib3mf_ubi8:latest - path: /out.zip + path: /lib3mf-repo/build/lib3mf.so.2 destination: dist - name: Upload Artifact uses: actions/upload-artifact@v2 with: - name: lib3mf_ubi8_gcc12.zip - path: dist/out.zip + name: lib3mf.so + path: dist/lib3mf.so.2 build-macos: runs-on: macos-latest @@ -175,7 +175,7 @@ jobs: working-directory: ./build assemble-sdk: runs-on: ubuntu-20.04 - needs: [build-windows-release, build-linux, build-macos] + needs: [build-windows-release, build-macos, build-linux-ubi8-gcc12] steps: - run: sudo apt install -y zip unzip - run: mkdir build diff --git a/CI/Dockerfile b/CI/Dockerfile index 94dec0242..3c24e9521 100644 --- a/CI/Dockerfile +++ b/CI/Dockerfile @@ -1,14 +1,62 @@ -# Copy this to root folder of lib3mf then build and run this image. -FROM ubuntu:20.04 +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest -RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install build-essential uuid-dev wget +LABEL maintainer="pradeep.gangatharan@autodesk.com" + +ENV GCCTOOLSET=gcc-toolset-12 + +RUN \ + microdnf update -y && \ + microdnf -y install --nodocs \ + git \ + git-lfs \ + wget \ + which \ + libuuid-devel \ + glibc-langpack-en \ + python39-pip \ + tar \ + gzip \ + zip \ + unzip \ + ${GCCTOOLSET} \ + && microdnf clean all + +ENV LD_LIBRARY_PATH=/opt/rh/${GCCTOOLSET}/root/usr/lib64:/opt/rh/${GCCTOOLSET}/root/usr/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +ENV PKG_CONFIG_PATH=/opt/rh/${GCCTOOLSET}/root/usr/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}} +ENV PATH=/opt/rh/${GCCTOOLSET}/root/usr/bin${PATH:+:${PATH}} + +# CMake +ARG CMAKE_VERSION=3.28.1 +ADD "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" /usr/tmp/ +RUN tar xzf /usr/tmp/cmake-$CMAKE_VERSION-linux-x86_64.tar.gz -C /opt && rm /usr/tmp/cmake-$CMAKE_VERSION-linux-x86_64.tar.gz +ENV PATH /opt/cmake-$CMAKE_VERSION-linux-x86_64/bin:${PATH} + + +RUN ln -s /opt/cmake-$CMAKE_VERSION-linux-x86_64/bin/cmake /usr/bin/cmake3 +RUN ln -s /opt/cmake-$CMAKE_VERSION-linux-x86_64/bin/cpack /usr/bin/cpack3 +RUN ln -s /opt/cmake-$CMAKE_VERSION-linux-x86_64/bin/ctest /usr/bin/ctest3 + +# Add Python site to PATH +ENV PATH /root/.local/bin:${PATH} + + + +RUN ldd --version +RUN cmake --version +RUN cmake3 --version +RUN git --version +RUN git lfs version +RUN python3 --version +RUN pip3 --version +RUN gcc --version -RUN wget -qO- "https://cmake.org/files/v3.28/cmake-3.28.1-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local ADD . lib3mf-repo WORKDIR "/lib3mf-repo" +RUN chmod +x cmake/GenerateMake.sh + RUN cmake/GenerateMake.sh WORKDIR "/lib3mf-repo/build" @@ -16,3 +64,9 @@ WORKDIR "/lib3mf-repo/build" RUN cmake --build . RUN ctest -V . + +WORKDIR "/../../" + + + + diff --git a/CI/Dockerfile.ubuntu b/CI/Dockerfile.ubuntu new file mode 100644 index 000000000..94dec0242 --- /dev/null +++ b/CI/Dockerfile.ubuntu @@ -0,0 +1,18 @@ +# Copy this to root folder of lib3mf then build and run this image. +FROM ubuntu:20.04 + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install build-essential uuid-dev wget + +RUN wget -qO- "https://cmake.org/files/v3.28/cmake-3.28.1-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local + +ADD . lib3mf-repo + +WORKDIR "/lib3mf-repo" + +RUN cmake/GenerateMake.sh + +WORKDIR "/lib3mf-repo/build" + +RUN cmake --build . + +RUN ctest -V . diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 6285f34a8..000000000 --- a/Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -FROM registry.access.redhat.com/ubi8/ubi-minimal:latest - -LABEL maintainer="pradeep.gangatharan@autodesk.com" - -ENV GCCTOOLSET=gcc-toolset-12 - -RUN \ - microdnf update -y && \ - microdnf -y install --nodocs \ - git \ - git-lfs \ - wget \ - which \ - libuuid-devel \ - glibc-langpack-en \ - python39-pip \ - tar \ - gzip \ - zip \ - unzip \ - ${GCCTOOLSET} \ - && microdnf clean all - -ENV LD_LIBRARY_PATH=/opt/rh/${GCCTOOLSET}/root/usr/lib64:/opt/rh/${GCCTOOLSET}/root/usr/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -ENV PKG_CONFIG_PATH=/opt/rh/${GCCTOOLSET}/root/usr/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}} -ENV PATH=/opt/rh/${GCCTOOLSET}/root/usr/bin${PATH:+:${PATH}} - -# CMake -ARG CMAKE_VERSION=3.28.1 -ADD "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" /usr/tmp/ -RUN tar xzf /usr/tmp/cmake-$CMAKE_VERSION-linux-x86_64.tar.gz -C /opt && rm /usr/tmp/cmake-$CMAKE_VERSION-linux-x86_64.tar.gz -ENV PATH /opt/cmake-$CMAKE_VERSION-linux-x86_64/bin:${PATH} - - -RUN ln -s /opt/cmake-$CMAKE_VERSION-linux-x86_64/bin/cmake /usr/bin/cmake3 -RUN ln -s /opt/cmake-$CMAKE_VERSION-linux-x86_64/bin/cpack /usr/bin/cpack3 -RUN ln -s /opt/cmake-$CMAKE_VERSION-linux-x86_64/bin/ctest /usr/bin/ctest3 - -# Add Python site to PATH -ENV PATH /root/.local/bin:${PATH} - - - -RUN ldd --version -RUN cmake --version -RUN cmake3 --version -RUN git --version -RUN git lfs version -RUN python3 --version -RUN pip3 --version -RUN gcc --version - - -ADD . lib3mf-repo - -WORKDIR "/lib3mf-repo" - -RUN chmod +x cmake/GenerateMake.sh - -RUN cmake/GenerateMake.sh - -WORKDIR "/lib3mf-repo/build" - -RUN cmake --build . - -RUN ctest -V . - -WORKDIR "/../../" - -RUN mkdir out - -RUN mkdir out/Bindings - -RUN cp -r ./lib3mf-repo/Autogenerated/Bindings/. ./out/Bindings/ - -RUN cp ./lib3mf-repo/build/lib3mf.so ./out/ - -RUN cd out && zip -r ../out.zip . - - - - -