|
| 1 | +name: Build Voxelization Toolkit Linux |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build_voxec: |
| 11 | + runs-on: ubuntu-20.04 |
| 12 | + container: rockylinux:8 |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Install Dependencies |
| 16 | + run: | |
| 17 | + yum update -y |
| 18 | + yum install -y gcc gcc-c++ git autoconf automake bison make zip cmake python3 \ |
| 19 | + bzip2 patch mesa-libGL-devel libffi-devel fontconfig-devel \ |
| 20 | + sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \ |
| 21 | + readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \ |
| 22 | + findutils |
| 23 | +
|
| 24 | + - name: Install aws cli |
| 25 | + run: | |
| 26 | + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" |
| 27 | + unzip awscliv2.zip |
| 28 | + ./aws/install |
| 29 | + rm -rf awscliv2.zip aws |
| 30 | + aws --version |
| 31 | +
|
| 32 | + - name: Checkout Repository |
| 33 | + uses: actions/checkout@v3 |
| 34 | + with: |
| 35 | + submodules: recursive |
| 36 | + |
| 37 | + - name: Checkout IfcOpenShell |
| 38 | + uses: actions/checkout@v3 |
| 39 | + with: |
| 40 | + repository: IfcOpenShell/IfcOpenShell |
| 41 | + path: IfcOpenShell |
| 42 | + token: ${{ secrets.BUILD_REPO_TOKEN }} |
| 43 | + submodules: recursive |
| 44 | + |
| 45 | + - name: Checkout Build Repository |
| 46 | + uses: actions/checkout@v3 |
| 47 | + with: |
| 48 | + repository: IfcOpenShell/build-outputs |
| 49 | + path: IfcOpenShell/build |
| 50 | + ref: rockylinux8-x64 |
| 51 | + lfs: true |
| 52 | + token: ${{ secrets.BUILD_REPO_TOKEN }} |
| 53 | + |
| 54 | + - name: Unpack IfcOpenShell Dependencies |
| 55 | + run: | |
| 56 | + install_root=$(find ./IfcOpenShell/build -maxdepth 4 -name install) |
| 57 | + find "$install_root" -type f -name 'cache-*.tar.gz' -maxdepth 1 -exec tar -xzf {} -C "$install_root" \; |
| 58 | +
|
| 59 | + # Not supported on docker |
| 60 | + # - name: ccache |
| 61 | + # uses: hendrikmuhs/ccache-action@v1 |
| 62 | + # with: |
| 63 | + # key: ${GITHUB_WORKFLOW}-rockylinux8-x64 |
| 64 | + |
| 65 | + - name: Run IfcOpenShell Build Script |
| 66 | + run: | |
| 67 | + CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release python3 ./IfcOpenShell/nix/build-all.py --diskcleanup IfcConvert python |
| 68 | +
|
| 69 | + - name: Compile voxec |
| 70 | + run: | |
| 71 | + base=`readlink -e ifcopenshell/build/Linux/x86_64/install` |
| 72 | + mkdir build |
| 73 | + cd build |
| 74 | + cmake .. ` |
| 75 | + "-DCMAKE_BUILD_TYPE=Release" ` |
| 76 | + "-DENABLE_PYTHON_WRAPPER=On" ` |
| 77 | + "-DENABLE_TESTS=Off" ` |
| 78 | + "-DUSE_BUILD_SCRIPT_OUTPUT=Off" ` |
| 79 | + "-DBoost_USE_STATIC_LIBS=On" ` |
| 80 | + "-DBoost_NO_BOOST_CMAKE=On" ` |
| 81 | + "-DCMAKE_INSTALL_PREFIX=../install" ` |
| 82 | + "-DIFC_INCLUDE_DIR=$base/ifcopenshell/include" ` |
| 83 | + "-DIFC_LIBRARY_DIR=$base/ifcopenshell/lib" ` |
| 84 | + "-DOCC_INCLUDE_DIR=$base/occt-7.8.1/include/opencascade" ` |
| 85 | + "-DOCC_LIBRARY_DIR=$base/occt-7.8.1/lib" ` |
| 86 | + "-DPython_EXECUTABLE=$base/python-3.9.11/bin/python3" ` |
| 87 | + "-DBOOST_ROOT=$base/install/boost-1.86.0" ` |
| 88 | + "-DGMP_LIBRARY_DIR=$base/gmp-6.2.1/lib" ` |
| 89 | + "-DMPFR_LIBRARY_DIR=$base/mpfr-3.1.6/lib" ` |
| 90 | + "-DSWIG_EXECUTABLE=$base/swig/bin/swig" |
| 91 | + make -j4 install |
| 92 | +
|
| 93 | + - name: Package .zip archives |
| 94 | + run: | |
| 95 | + base=`readlink -e ifcopenshell/build/Linux/x86_64/install` |
| 96 | + mkdir -p $GITHUB_WORKSPACE/package |
| 97 | + cd $GITHUB_WORKSPACE/package |
| 98 | +
|
| 99 | + cp -R $base/python-3.9.11/lib/python3.9/site-packages/voxec |
| 100 | + cp $GITHUB_WORKSPACE/pyproject.toml . |
| 101 | + |
| 102 | + $base/python-3.9.11/bin/python3 -m pip install build auditwheel |
| 103 | + $base/python-3.9.11/bin/python3 -m build -w |
| 104 | + $base/python-3.9.11/bin/python3 -m auditwheel repair dist/*.whl -w audited |
| 105 | +
|
| 106 | + - name: Publish a Python distribution to PyPI |
| 107 | + uses: ortega2247/pypi-upload-action@master |
| 108 | + with: |
| 109 | + user: __token__ |
| 110 | + password: ${{ secrets.PYPI_API_TOKEN }} |
| 111 | + packages_dir: package\audited |
0 commit comments