Skip to content

Build Extensions

Build Extensions #203

name: Build-Extensions
on: workflow_dispatch
jobs:
build-linux-extensions-x86_64:
runs-on: kuzu-self-hosted-linux-building-x86_64
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
run: make extension-release NUM_THREADS=$(nproc)
- name: Collect built artifacts
run: /opt/python/cp310-cp310/bin/python scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_linux-x86_64
path: extension-artifacts
build-linux-extensions-aarch64:
runs-on: kuzu-self-hosted-linux-building-aarch64
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
run: make extension-release NUM_THREADS=$(nproc)
- name: Collect built artifacts
run: /opt/python/cp310-cp310/bin/python scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_linux-aarch64
path: extension-artifacts
build-linux-extensions-x86:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start Docker container
run: |
docker run -d --name kuzu-x86 \
-v $PWD:/kuzu -w /kuzu \
-e NUM_THREADS=$(nproc) -e CC=gcc -e CXX=g++ \
i386/debian:stable tail -f /dev/null
- name: Install dependencies
run: |
docker exec kuzu-x86 apt-get update
docker exec kuzu-x86 apt-get install -y git python3 ninja-build build-essential cmake libssl-dev
- name: Build precompiled extensions
run: |
docker exec kuzu-x86 make extension-release NUM_THREADS=$(nproc)
- name: Collect built artifacts
run: |
python3 scripts/collect-extensions.py
sudo chown -R $USER:$USER extension-artifacts
sudo chmod -R 755 extension-artifacts
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_linux-x86
path: extension-artifacts
- name: Stop Docker container
run: docker stop kuzu-x86
build-mac-extensions-arm64:
runs-on: self-hosted-mac-arm
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
run: env OPENSSL_ROOT_DIR=/opt/homebrew/Cellar/openssl@3/3.3.0 make extension-release NUM_THREADS=$(sysctl -n hw.logicalcpu)
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
CMAKE_OSX_ARCHITECTURES: "arm64"
- name: Collect built artifacts
run: python3 scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_osx-arm64
path: extension-artifacts
build-mac-extensions-x86_64:
runs-on: self-hosted-mac-x64
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
run: make extension-release NUM_THREADS=$(sysctl -n hw.logicalcpu)
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
CMAKE_OSX_ARCHITECTURES: "x86_64"
- name: Collect built artifacts
run: python3 scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_osx-x86_64
path: extension-artifacts
build-windows-extensions-x86_64:
runs-on: self-hosted-windows
env:
NUM_THREADS: 18
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
make extension-release
- name: Collect built artifacts
run: python scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_win-x86_64
path: extension-artifacts
update-extensions-repo:
runs-on: ubuntu-latest
needs:
- build-linux-extensions-x86_64
- build-linux-extensions-aarch64
- build-linux-extensions-x86
- build-mac-extensions-arm64
- build-mac-extensions-x86_64
- build-windows-extensions-x86_64
steps:
- uses: actions/checkout@v4
- name: Detect release version
run: |
echo "RELEASE_VERSION=v$(cat CMakeLists.txt | grep "DKUZU_EXTENSION_VERSION" | cut -d '"' -f 2 )" >> $GITHUB_ENV
- name: Delete checked out repository
run: cd .. && rm -rf kuzudb
- uses: actions/checkout@v4
with:
repository: kuzudb/extension
token: ${{ secrets.DOC_PUSH_TOKEN }}
- name: Clear old artifacts
run: |
rm -rf releases/$RELEASE_VERSION/
- name: Create temporary directory for artifacts
run: |
mkdir -p extension-artifacts
mkdir -p extension-artifacts/linux_amd64
mkdir -p extension-artifacts/linux_arm64
mkdir -p extension-artifacts/linux_x86
mkdir -p extension-artifacts/osx_amd64
mkdir -p extension-artifacts/osx_arm64
mkdir -p extension-artifacts/win_amd64
- name: Download built artifacts for linux-x86_64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_linux-x86_64
path: extension-artifacts/linux_amd64
- name: Download built artifacts for linux-aarch64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_linux-aarch64
path: extension-artifacts/linux_arm64
- name: Download built artifacts for linux-x86
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_linux-x86
path: extension-artifacts/linux_x86
- name: Download built artifacts for osx-x86_64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_osx-x86_64
path: extension-artifacts/osx_amd64
- name: Download built artifacts for osx-aarch64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_osx-arm64
path: extension-artifacts/osx_arm64
- name: Download built artifacts for windows-x86_64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_win-x86_64
path: extension-artifacts/win_amd64
- name: Copy built artifacts
run: |
rsync -av extension-artifacts/ releases/$RELEASE_VERSION/
- name: Remove temporary directory
run: rm -rf extension-artifacts
- name: Set artifact permissions
run: |
chmod -R 755 releases/$RELEASE_VERSION
- name: List downloaded artifacts
run: ls -R releases/$RELEASE_VERSION
- name: Push changes
run: |
git checkout -b "extensions-update-${{ github.sha }}"
git config --global user.name "CI User"
git config --global user.email "[email protected]"
git add -A
git commit -m "Update extensions (CI) - $RELEASE_VERSION"
git push -u origin "extensions-update-${{ github.sha }}"
- name: Create pull request
run: |
echo "${{ secrets.DOC_PUSH_TOKEN }}" > token.txt
gh auth login --with-token < token.txt
rm -rf token.txt
gh pr create \
--body "Action triggered by CI workflow." \
--title "Update extensions (CI) - $RELEASE_VERSION" \
--head "extensions-update-${{ github.sha }}" \
--base "main"
- name: Merge pull request
run: |
gh pr merge --auto --squash --delete-branch