From 93564d1de70674d08d802b2e29dbfa2c2be75204 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 00:17:05 +0000 Subject: [PATCH 01/12] add gh action --- .github/workflows/ci.yml | 100 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..2ce94acef8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,100 @@ +name: CI + +on: + push: + + +jobs: + + activate: + runs-on: ubuntu-latest + if: | + github.repository == 'feelpp/IfcOpenShell' && + !startsWith(github.event.head_commit.message, 'Release ') && + !contains(github.event.head_commit.message, 'ci skip') + steps: + - run: echo ok go + + build: + runs-on: self-hosted + needs: activate + steps: + - uses: actions/checkout@v2 +# - name: python +# run: | +# python3 mo.py -i data/ifc_files/3pieces_1zone-with-materials-with-sensors.ifc -o data/ifc_files/3pieces_1zone-with-materials-with-sensors +# cat toto.mo + - name: Update ubuntu + run: | + sudo apt update + sudo apt-get install git cmake gcc g++ libboost1.67-all-dev python3-all-dev swig libpcre3-dev libxml2-dev + sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev + - name: Build ibat + run: | + mkdir build && cd build + cmake \ + -DCMAKE_INSTALL_PREFIX=./install/ \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=./install/ \ + -DCMAKE_SYSTEM_PREFIX_PATH=./install/ \ + -DOCC_INCLUDE_DIR=/usr/include/oce \ + -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \ + -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \ + -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \ + -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \ + -DCOLLADA_SUPPORT=Off \ + -DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \ + -DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so \ + ../cmake + make -j10 + make install + - name: Package + run: | + make package + working-directory: build + - name: Upload + uses: actions/upload-artifact@v2 + with: + # Artifact name + name: ifcos-artifacts + # Directory containing files to upload + path: build/assets/ifcos-* + + deliver: + runs-on: ubuntu-20.04 + needs: build + name: Docker Build, Tag, Push + + steps: + - uses: actions/checkout@v2 + with: + lfs: true + + - name: Download + uses: actions/download-artifact@v2 + with: + # Artifact name + name: ifcos-artifacts + path: artifacts/ + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + - + name: Build container image + uses: docker/build-push-action@v2 + with: + context: artifacts + repository: feelpp/ifcopenshell + tags: ghcr.io/feelpp/ifcopenshell:latest + file: ./Dockerfile + push: true \ No newline at end of file From 16ad45440fc73bed71e996bb9be6e975a001b84d Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 00:17:27 +0000 Subject: [PATCH 02/12] add package using cpack and install properly --- cmake/CMakeLists.txt | 38 +++++++++++++++++++++++++++++++++++++- src/ifcwrap/CMakeLists.txt | 3 ++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 70d85bb840..a64590ba74 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -21,7 +21,7 @@ cmake_minimum_required(VERSION 3.1.3) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged -project (IfcOpenShell) +project (IfcOpenShell VERSION 0.6.0) foreach(max_year RANGE 2014 2030) set(max_sdk "$ENV{ADSK_3DSMAX_SDK_${max_year}}") @@ -716,3 +716,39 @@ INSTALL(FILES ${SERIALIZERS_S_FILES} DESTINATION ${INCLUDEDIR}/serializers/schema_dependent ) endif() + + +list(APPEND CPACK_SOURCE_IGNORE_FILES + .git + .gitignore + ) + +set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}") +set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}${EXTRA_VERSION}") +SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}-${CMAKE_SYSTEM_NAME}") +set(CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/assets") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IfcOpenShell") +set(CPACK_PACKAGE_DESCRIPTION "IfcOpenShell.") +set(CPACK_PACKAGE_VENDOR "Cemosis") +set(CPACK_PACKAGE_CONTACT "Christophe Prud'homme ") +set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") + + +set(CPACK_GENERATOR "TGZ;DEB") +set(CPACK_SOURCE_GENERATOR "TGZ") + + +set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libxml2, liboce-foundation11, liboce-modeling11, liboce-ocaf11, liboce-visualization11, liboce-ocaf-lite11") +set(CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") +set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}") +set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") +set(CPACK_DEBIAN_PACKAGE_SECTION "science") +set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}${EXTRA_VERSION}") +set(CPACK_DEBIAN_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}") +#set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/cmake/debian/postinst") + +include(CPack) diff --git a/src/ifcwrap/CMakeLists.txt b/src/ifcwrap/CMakeLists.txt index 0e8a695656..b187c619be 100644 --- a/src/ifcwrap/CMakeLists.txt +++ b/src/ifcwrap/CMakeLists.txt @@ -79,7 +79,8 @@ IF(PYTHONINTERP_FOUND AND NOT "${PYTHON_EXECUTABLE}" STREQUAL "") OUTPUT_VARIABLE python_package_dir ) ENDIF() - + set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/install/lib ) + set(python_package_dir ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/) IF("${python_package_dir}" STREQUAL "") MESSAGE(WARNING "Unable to locate Python site-package directory, unable to install the Python wrapper") ELSE() From b17ef5d57dcb3856fa6a05d0c2b4179bbc56d9b0 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 00:23:14 +0000 Subject: [PATCH 03/12] prepare for docker image of ifcopenshell --- .github/workflows/ci.yml | 16 ++++++++-------- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ce94acef8..9e1498f390 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,16 +20,15 @@ jobs: needs: activate steps: - uses: actions/checkout@v2 -# - name: python -# run: | -# python3 mo.py -i data/ifc_files/3pieces_1zone-with-materials-with-sensors.ifc -o data/ifc_files/3pieces_1zone-with-materials-with-sensors -# cat toto.mo - - name: Update ubuntu + + - + name: Update ubuntu run: | sudo apt update sudo apt-get install git cmake gcc g++ libboost1.67-all-dev python3-all-dev swig libpcre3-dev libxml2-dev sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev - - name: Build ibat + - + name: Build ifcopenshell run: | mkdir build && cd build cmake \ @@ -48,7 +47,8 @@ jobs: ../cmake make -j10 make install - - name: Package + - + name: Package run: | make package working-directory: build @@ -58,7 +58,7 @@ jobs: # Artifact name name: ifcos-artifacts # Directory containing files to upload - path: build/assets/ifcos-* + path: build/assets/Ifc* deliver: runs-on: ubuntu-20.04 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..e47b919e90 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# -*- mode: Dockerfile -*- + +FROM ubuntu:focal + +ARG CHANNEL +ENV CHANNEL=${CHANNEL:-latest} +RUN apt-get update \ + && apt-get install -y \ + vim \ + ssh \ + sudo \ + wget \ + software-properties-common ;\ + rm -rf /var/lib/apt/lists/* + +RUN useradd --user-group --create-home --shell /bin/bash feelpp ;\ + echo "feelpp ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + + +ENV DEBIAN_FRONTEND=noninteractive +RUN echo "deb http://archive.ubuntu.com/ubuntu focal-proposed main restricted" | tee -a /etc/apt/sources.list; \ + echo "deb http://archive.ubuntu.com/ubuntu focal-proposed universe" | tee -a /etc/apt/sources.list; \ + echo "deb http://archive.ubuntu.com/ubuntu focal-proposed multiverse" | tee -a /etc/apt/sources.list; \ + apt-get -qq update; \ + apt-get -y install tzdata dos2unix rsync; \ + apt-get -y install libxml2 liboce-foundation11 liboce-modeling11 liboce-ocaf11 liboce-visualization11 liboce-ocaf-lite11; \ + rm -rf /var/lib/apt/lists/* ; + +COPY . /home/feelpp/ +RUN ls -lrtR /home/feelpp + +RUN dpkg -i /home/feelpp/*.deb + +USER feelpp + From 7bced89687700b37aa1831082a98d6a4eb2e7647 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 00:25:28 +0000 Subject: [PATCH 04/12] use host ubuntu 20.04 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e1498f390..3ac27005e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - run: echo ok go build: - runs-on: self-hosted + runs-on: ubuntu-20.04 needs: activate steps: - uses: actions/checkout@v2 From 66b0bdd01efea725ae977c8f6d50d7757ad786e9 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 07:42:31 +0000 Subject: [PATCH 05/12] up ci --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ac27005e5..61e7a7d136 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,10 +32,10 @@ jobs: run: | mkdir build && cd build cmake \ - -DCMAKE_INSTALL_PREFIX=./install/ \ + -DCMAKE_INSTALL_PREFIX=$PWD/install/ \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH=./install/ \ - -DCMAKE_SYSTEM_PREFIX_PATH=./install/ \ + -DCMAKE_PREFIX_PATH=/usr \ + -DCMAKE_SYSTEM_PREFIX_PATH=/usr \ -DOCC_INCLUDE_DIR=/usr/include/oce \ -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \ -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \ From 9557aec04856314fd212eb0f15c6036f4d6914c1 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 12:54:05 +0000 Subject: [PATCH 06/12] use GNUInstallDirs to define properly the installation directories fix typo in name LIBARY -> LIBRARY --- cmake/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index a64590ba74..01f5e790b8 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -54,7 +54,7 @@ OPTION(USERSPACE_PYTHON_PREFIX "Installs IfcPython for the current user only ins # TODO QtViewer is deprecated ATM as it uses the 0.4 API # OPTION(BUILD_QTVIEWER "Build IfcOpenShell Qt GUI Viewer (requires Qt 4 framework)." OFF) - +include(GNUInstallDirs) if((BUILD_CONVERT OR BUILD_GEOMSERVER OR BUILD_IFCPYTHON) AND (NOT BUILD_IFCGEOM)) message(STATUS "'IfcGeom' is required with current outputs") set(BUILD_IFCGEOM ON) @@ -65,7 +65,7 @@ IF(NOT BINDIR) set(BINDIR bin) ENDIF() IF(NOT IS_ABSOLUTE ${BINDIR}) - set(BINDIR ${CMAKE_INSTALL_PREFIX}/${BINDIR}) + set(BINDIR ${CMAKE_INSTALL_BINDIR}) ENDIF() MESSAGE(STATUS "BINDIR: ${BINDIR}") @@ -73,7 +73,7 @@ IF(NOT INCLUDEDIR) set(INCLUDEDIR include) ENDIF() IF(NOT IS_ABSOLUTE ${INCLUDEDIR}) - set(INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${INCLUDEDIR}) + set(INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) ENDIF() MESSAGE(STATUS "INCLUDEDIR: ${INCLUDEDIR}") @@ -81,11 +81,11 @@ IF(NOT LIBDIR) set(LIBDIR lib) ENDIF() IF(NOT IS_ABSOLUTE ${LIBDIR}) - set(LIBDIR ${CMAKE_INSTALL_PREFIX}/${LIBDIR}) + set(LIBDIR ${CMAKE_INSTALL_LIBDIR}) ENDIF() MESSAGE(STATUS "LIBDIR: ${LIBDIR}") -set(IFCOPENSHELL_LIBARY_DIR "") # for *nix rpaths +set(IFCOPENSHELL_LIBRARY_DIR "") # for *nix rpaths if (BUILD_SHARED_LIBS) add_definitions(-DIFC_SHARED_BUILD) @@ -95,7 +95,7 @@ if (BUILD_SHARED_LIBS) # There will be couple hundreds of these so suppress them away, https://msdn.microsoft.com/en-us/library/esew7y1w.aspx add_definitions(-wd4251) endif() - set(IFCOPENSHELL_LIBARY_DIR "${LIBDIR}") + set(IFCOPENSHELL_LIBRARY_DIR "${LIBDIR}") endif() # Create cache entries if absent for environment variables @@ -624,7 +624,7 @@ if ((NOT WIN32) AND BUILD_SHARED_LIBS) # Only set RPATHs when building shared libraries (i.e. IfcParse and # IfcGeom are dynamically linked). Not necessarily a perfect solution # but probably a good indication of whether RPATHs are necessary. - SET_INSTALL_RPATHS(IfcConvert "${IFCOPENSHELL_LIBARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS};${OPENCOLLADA_LIBRARY_DIR}") + SET_INSTALL_RPATHS(IfcConvert "${IFCOPENSHELL_LIBRARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS};${OPENCOLLADA_LIBRARY_DIR}") endif() INSTALL(TARGETS IfcConvert @@ -645,7 +645,7 @@ ADD_EXECUTABLE(IfcGeomServer ${SOURCE_FILES}) TARGET_LINK_LIBRARIES(IfcGeomServer ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES}) if ((NOT WIN32) AND BUILD_SHARED_LIBS) - SET_INSTALL_RPATHS(IfcGeomServer "${IFCOPENSHELL_LIBARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS}") + SET_INSTALL_RPATHS(IfcGeomServer "${IFCOPENSHELL_LIBRARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS}") endif() INSTALL(TARGETS IfcGeomServer From 2e0fc73d027d856f04b3fc46d023ec5e67effb39 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 12:55:30 +0000 Subject: [PATCH 07/12] fix python package dir @aothms the selection of the directory needs to fixed but the current choice is reasonnable --- src/ifcwrap/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ifcwrap/CMakeLists.txt b/src/ifcwrap/CMakeLists.txt index b187c619be..d386bfd8c1 100644 --- a/src/ifcwrap/CMakeLists.txt +++ b/src/ifcwrap/CMakeLists.txt @@ -21,7 +21,7 @@ FIND_PACKAGE(SWIG) IF(NOT SWIG_FOUND) MESSAGE(FATAL_ERROR "BUILD_IFCPYTHON enabled, but unable to find SWIG. Disable BUILD_IFCPYTHON or fix SWIG paths to proceed.") ENDIF() - +include(GNUInstallDirs) INCLUDE(${SWIG_USE_FILE}) IF(NOT "$ENV{PYTHON_INCLUDE_DIR}" STREQUAL "") @@ -79,10 +79,9 @@ IF(PYTHONINTERP_FOUND AND NOT "${PYTHON_EXECUTABLE}" STREQUAL "") OUTPUT_VARIABLE python_package_dir ) ENDIF() - set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/install/lib ) set(python_package_dir ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/) IF("${python_package_dir}" STREQUAL "") - MESSAGE(WARNING "Unable to locate Python site-package directory, unable to install the Python wrapper") + MESSAGE(WARNING "Unable to locate Python site-package directory, unals /ble to install the Python wrapper") ELSE() FILE(GLOB_RECURSE sourcefiles "${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/*" From 2805cda64b719aeecba3dad7118cba01bad22026 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 13:40:19 +0000 Subject: [PATCH 08/12] Release v0.6.0 alpha.1 add EXTRA_VERSION to set prerelease (to be set to null string for final release) add release workflow --- .github/workflows/release.yml | 94 +++++++++++++++++++++++++++++++++++ cmake/CMakeLists.txt | 3 ++ 2 files changed, 97 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..f5296e378d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,94 @@ +name: Release + +on: + push: + tags: + - 'v[0-9].[0-9].[0-9]*' + +jobs: + activate: + if: github.repository == 'feelpp/IfcOpenShell' + runs-on: ubuntu-latest + steps: + - run: echo ok go + build: + needs: activate + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + lfs: true + - + name: Update ubuntu + run: | + sudo apt update + sudo apt-get install git cmake gcc g++ libboost1.67-all-dev python3-all-dev swig libpcre3-dev libxml2-dev + sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir build && cd build + cmake \ + -DCMAKE_INSTALL_PREFIX=$PWD/install/ \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=/usr \ + -DCMAKE_SYSTEM_PREFIX_PATH=/usr \ + -DOCC_INCLUDE_DIR=/usr/include/oce \ + -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \ + -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \ + -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \ + -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \ + -DCOLLADA_SUPPORT=Off \ + -DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \ + -DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so \ + ../cmake + make -j10 + make install + - name: Package + id: package + run: | + make package + echo ::set-output name=tgz::$( ls assets/*.tar.gz | head -n 1 | xargs basename ) + echo ::set-output name=deb::$( ls assets/*.deb | head -n 1 | xargs basename ) + working-directory: build + env: + CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release + id: release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: true + body: | + Changes to this release + - add github actions support #1306 + - + See more details in the documentation +# body_path: build/CHANGELOG.md + - name: Upload TGZ + id: upload-tgz + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: build/assets/${{ steps.package.outputs.tgz }} + asset_name: ${{ steps.package.outputs.tgz }} + asset_content_type: application/x-gzip + - name: Upload DEB + id: upload-deb + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: build/assets/${{ steps.package.outputs.deb }} + asset_name: ${{ steps.package.outputs.deb }} + asset_content_type: application/vnd.debian.binary-package diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 01f5e790b8..5274042f32 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -23,6 +23,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged project (IfcOpenShell VERSION 0.6.0) +# use extra version to make pre-release using eg semver +set( EXTRA_VERSION "-alpha.1") + foreach(max_year RANGE 2014 2030) set(max_sdk "$ENV{ADSK_3DSMAX_SDK_${max_year}}") if (NOT "${max_sdk}" STREQUAL "") From 28126e0c518e0e8e64d58e76ba8a46450e437ba9 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 14:26:07 +0000 Subject: [PATCH 09/12] Release V0.6.0 alpha 2 install in standard python dir bump up version --- cmake/CMakeLists.txt | 2 +- src/ifcwrap/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 5274042f32..339dc620d7 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -24,7 +24,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged project (IfcOpenShell VERSION 0.6.0) # use extra version to make pre-release using eg semver -set( EXTRA_VERSION "-alpha.1") +set( EXTRA_VERSION "-alpha.2") foreach(max_year RANGE 2014 2030) set(max_sdk "$ENV{ADSK_3DSMAX_SDK_${max_year}}") diff --git a/src/ifcwrap/CMakeLists.txt b/src/ifcwrap/CMakeLists.txt index d386bfd8c1..32ceaf1a8a 100644 --- a/src/ifcwrap/CMakeLists.txt +++ b/src/ifcwrap/CMakeLists.txt @@ -79,7 +79,7 @@ IF(PYTHONINTERP_FOUND AND NOT "${PYTHON_EXECUTABLE}" STREQUAL "") OUTPUT_VARIABLE python_package_dir ) ENDIF() - set(python_package_dir ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/) + set(python_package_dir ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}/dist-packages/) IF("${python_package_dir}" STREQUAL "") MESSAGE(WARNING "Unable to locate Python site-package directory, unals /ble to install the Python wrapper") ELSE() From cad1e08da6a8d13caaa35f9a1d5b9839b25f15b5 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 9 Feb 2021 15:08:22 +0000 Subject: [PATCH 10/12] Release V 0.6.0 alpha.2 --- .github/workflows/release.yml | 3 ++- cmake/CMakeLists.txt | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5296e378d..629710aa0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,8 @@ jobs: body: | Changes to this release - add github actions support #1306 - - + - add boost depends to ifcopenshell deb packaging + - See more details in the documentation # body_path: build/CHANGELOG.md - name: Upload TGZ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 339dc620d7..5a0b3f33cd 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -741,11 +741,15 @@ set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") set(CPACK_GENERATOR "TGZ;DEB") set(CPACK_SOURCE_GENERATOR "TGZ") - - +message(STATUS "boost ${BOOST_COMPONENTS}") +FOREACH(COMPONENT IN ITEMS ${BOOST_COMPONENTS}) + string(REPLACE "_" "-" COMP ${COMPONENT}) + set(BOOST_DEPS "${BOOST_DEPS}, libboost-${COMP}1.67.0") +endforeach(COMPONENT) +message(STATUS "deps ${BOOST_DEPS}") set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libxml2, liboce-foundation11, liboce-modeling11, liboce-ocaf11, liboce-visualization11, liboce-ocaf-lite11") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libxml2, liboce-foundation11, liboce-modeling11, liboce-ocaf11, liboce-visualization11, liboce-ocaf-lite11, libpython3.8 ${BOOST_DEPS}") set(CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}") set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") From f99283b5725696ba0c2fb01dfc639a0e184d8256 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Wed, 10 Feb 2021 07:04:43 +0000 Subject: [PATCH 11/12] add runtime depends --- Dockerfile | 6 ++++-- cmake/CMakeLists.txt | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e47b919e90..723158e8dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,10 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu focal-proposed main restricted" | echo "deb http://archive.ubuntu.com/ubuntu focal-proposed multiverse" | tee -a /etc/apt/sources.list; \ apt-get -qq update; \ apt-get -y install tzdata dos2unix rsync; \ - apt-get -y install libxml2 liboce-foundation11 liboce-modeling11 liboce-ocaf11 liboce-visualization11 liboce-ocaf-lite11; \ - rm -rf /var/lib/apt/lists/* ; + apt-get -y install python3 libxml2 liboce-foundation11 liboce-modeling11 liboce-ocaf11 liboce-visualization11 \ + liboce-ocaf-lite11 libpython3.8 libboost-system1.67.0 libboost-program-options1.67.0 \ + libboost-regex1.67.0 libboost-thread1.67.0 libboost-date-time1.67.0; \ + rm -rf /var/lib/apt/lists/* ; COPY . /home/feelpp/ RUN ls -lrtR /home/feelpp diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 5a0b3f33cd..af4308728a 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -741,15 +741,15 @@ set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") set(CPACK_GENERATOR "TGZ;DEB") set(CPACK_SOURCE_GENERATOR "TGZ") -message(STATUS "boost ${BOOST_COMPONENTS}") + FOREACH(COMPONENT IN ITEMS ${BOOST_COMPONENTS}) string(REPLACE "_" "-" COMP ${COMPONENT}) set(BOOST_DEPS "${BOOST_DEPS}, libboost-${COMP}1.67.0") endforeach(COMPONENT) -message(STATUS "deps ${BOOST_DEPS}") + set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libxml2, liboce-foundation11, liboce-modeling11, liboce-ocaf11, liboce-visualization11, liboce-ocaf-lite11, libpython3.8 ${BOOST_DEPS}") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libxml2, liboce-foundation11, liboce-modeling11, liboce-ocaf11, liboce-visualization11, liboce-ocaf-lite11, libpython3.8 ${BOOST_DEPS}") set(CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}") set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") From 836a830989e75f49622f55bc6d19f45d6b8fe0a3 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Wed, 10 Feb 2021 07:05:16 +0000 Subject: [PATCH 12/12] Release V 0.6.0 alpha 3 --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index af4308728a..b9d6f2a168 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -24,7 +24,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged project (IfcOpenShell VERSION 0.6.0) # use extra version to make pre-release using eg semver -set( EXTRA_VERSION "-alpha.2") +set( EXTRA_VERSION "-alpha.3") foreach(max_year RANGE 2014 2030) set(max_sdk "$ENV{ADSK_3DSMAX_SDK_${max_year}}")