Build IfcOpenShell Linux ARM #96
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build IfcOpenShell Linux ARM | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build_ifcopenshell: | |
| runs-on: ubuntu-22.04-arm | |
| container: arm64v8/rockylinux:9 | |
| steps: | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 | |
| - name: Install Python | |
| # Installs latest Python version so it's preferred by uv over Rocky's system Python. | |
| run: uv python install | |
| - name: Install Dependencies | |
| run: | | |
| dnf update -y | |
| dnf install -y gcc gcc-c++ git autoconf automake bison make zip cmake python3 python3-pip \ | |
| bzip2 patch mesa-libGL-devel libffi-devel fontconfig-devel \ | |
| sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \ | |
| readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \ | |
| findutils xz byacc | |
| git config --global --add safe.directory '*' | |
| - name: Install aws cli | |
| run: | | |
| curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" | |
| unzip awscliv2.zip | |
| ./aws/install | |
| rm -rf awscliv2.zip aws | |
| aws --version | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Checkout Build Repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: IfcOpenShell/build-outputs | |
| path: ./build | |
| ref: rockylinux9-arm64 | |
| lfs: true | |
| token: ${{ secrets.BUILD_REPO_TOKEN }} | |
| - name: Unpack Dependencies | |
| run: | | |
| cd build | |
| uv run ../nix/cache_dependencies.py unpack | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2.22 | |
| with: | |
| key: ubuntu-22.04-${{ runner.arch }}-rockylinux9 | |
| - name: Run Build Script | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release uv run ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log | |
| - name: Upload Build Logs | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-logs-rocky-arm64 | |
| path: | | |
| build.log | |
| build/*/*/logs/*.log | |
| retention-days: 30 | |
| - name: Pack Dependencies | |
| run: | | |
| cd build | |
| uv run ../nix/cache_dependencies.py pack | |
| - name: Commit and Push Changes to Build Repository | |
| run: | | |
| cd build | |
| git config user.name "IfcOpenBot" | |
| git config user.email "ifcopenbot@ifcopenshell.org" | |
| git add "$(find . -maxdepth 4 -name install)/*.tar.gz" | |
| git commit -m "Update build artifacts [skip ci]" || echo "No changes to commit" | |
| git push || true | |
| - name: Package .zip archives | |
| run: | | |
| VERSION=v`cat VERSION` | |
| cd ./build/`uname`/*/install/ifcopenshell | |
| mkdir ~/output | |
| ls -d python-* | while read py_version; do | |
| postfix=`echo ${py_version: -1} | sed s/[0-9]//` | |
| numbers=`echo $py_version | grep -oE '[0-9]+\.[0-9]+' | tr -d '.'` | |
| py_version_major=python-${numbers}$postfix | |
| pushd . > /dev/null | |
| cd $py_version | |
| if [ ! -d ifcopenshell ]; then | |
| mkdir ../ifcopenshell_ | |
| mv * ../ifcopenshell_ | |
| mv ../ifcopenshell_ ifcopenshell | |
| fi | |
| [ -d ifcopenshell/__pycache__ ] && rm -rf ifcopenshell/__pycache__ | |
| find ifcopenshell -name "*.pyc" -delete | |
| zip -r -qq ifcopenshell-${py_version_major}-${VERSION}-${GITHUB_SHA:0:7}-linuxarm64.zip ifcopenshell/* | |
| mv *.zip ~/output | |
| popd > /dev/null | |
| done | |
| cd bin | |
| rm *.zip || true | |
| ls | while read exe; do | |
| zip -qq -r ${exe}-${VERSION}-${GITHUB_SHA:0:7}-linuxarm64.zip $exe | |
| done | |
| mv *.zip ~/output | |
| cd .. | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_UPLOAD_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_UPLOAD_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-1 | |
| - name: Upload .zip archives to S3 | |
| run: | | |
| aws s3 cp ~/output s3://ifcopenshell-builds/ --recursive |