name: ci-ifcopenshell-docker on: workflow_dispatch: push: tags: - v0.** jobs: activate: runs-on: ubuntu-22.04 if: | github.repository == 'IfcOpenShell/IfcOpenShell' && !startsWith(github.event.head_commit.message, 'Release ') && !contains(github.event.head_commit.message, 'ci skip') steps: - run: echo ok go build: runs-on: ubuntu-22.04 needs: activate steps: - uses: actions/checkout@v6 with: submodules: recursive - name: Install dependencies run: | sudo apt update sudo apt-get install --no-install-recommends \ git cmake gcc g++ libboost-all-dev python3-all-dev swig libpcre3-dev libxml2-dev \ libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \ libhdf5-dev libcgal-dev nlohmann-json3-dev libeigen3-dev - name: ccache uses: hendrikmuhs/ccache-action@v1.2.23 - name: Build ifcopenshell run: | mkdir build && cd build cmake \ -DCMAKE_INSTALL_PREFIX=$PWD/install/ \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=/usr \ -DCMAKE_SYSTEM_PREFIX_PATH=/usr \ -DBUILD_PACKAGE=On \ -DOCC_INCLUDE_DIR=/usr/include/opencascade \ -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \ -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \ -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.10 \ -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.10.so \ -DCOLLADA_SUPPORT=Off \ -DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \ -DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so \ -DCGAL_INCLUDE_DIR=/usr/include \ -DGMP_INCLUDE_DIR=/usr/include \ -DMPFR_INCLUDE_DIR=/usr/include \ -DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \ -DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \ -DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \ -DGLTF_SUPPORT=On \ -DJSON_INCLUDE_DIR=/usr/include \ -DEIGEN_DIR=/usr/include/eigen3 \ ../cmake make -j $(nproc) make install - name: Package run: | make package working-directory: build - name: Upload uses: actions/upload-artifact@v7 with: # Artifact name name: ifcos-artifacts # Directory containing files to upload path: build/assets/Ifc* deliver: runs-on: ubuntu-22.04 needs: build name: Docker Build, Tag, Push steps: - uses: actions/checkout@v6 with: lfs: true - name: Download uses: actions/download-artifact@v8.0.1 with: # Artifact name name: ifcos-artifacts path: artifacts/ - name: Set up QEMU uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - name: Login to Dockerhub uses: docker/login-action@v4 with: username: aecgeeks password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Build container image uses: docker/build-push-action@v7 with: context: artifacts repository: aecgeeks/ifcopenshell # Since the dispatch is set to `tag`, `github.ref_name` should evaluate to the pushed tag # On a workflow dispatch, `ref_name` will take on the value from the dispatch payload tags: aecgeeks/ifcopenshell:${{ github.ref_name }}${{ github.ref_name == github.event.repository.default_branch && ',aecgeeks/ifcopenshell:22.04' }} file: ./Dockerfile push: true