name: Bundle Static Libraries on: workflow_call: inputs: override_git_describe: type: string git_ref: type: string skip_tests: type: string workflow_dispatch: inputs: override_git_describe: type: string git_ref: type: string skip_tests: type: string push: branches-ignore: - 'main' - 'feature' - 'v*.*-*' paths-ignore: - '**' - '!.github/workflows/BundleStaticLibs.yml' pull_request: types: [opened, reopened, ready_for_review] paths-ignore: - '**' - '!.github/workflows/BundleStaticLibs.yml' concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}-${{ inputs.override_git_describe }} cancel-in-progress: true env: GH_TOKEN: ${{ secrets.GH_TOKEN }} OVERRIDE_GIT_DESCRIBE: ${{ inputs.override_git_describe }} jobs: bundle-osx-static-libs: name: OSX static libs strategy: matrix: include: - xcode_target_flag: "x86_64" architecture: "amd64" - xcode_target_flag: "arm64" architecture: "arm64" runs-on: macos-latest env: EXTENSION_CONFIGS: '${GITHUB_WORKSPACE}/.github/config/bundled_extensions.cmake' ENABLE_EXTENSION_AUTOLOADING: 1 ENABLE_EXTENSION_AUTOINSTALL: 1 GEN: ninja OSX_BUILD_ARCH: ${{ matrix.xcode_target_flag }} DUCKDB_PLATFORM: osx_${{ matrix.architecture }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{ inputs.git_ref }} - uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install Ninja run: brew install ninja - name: Setup Ccache uses: hendrikmuhs/ccache-action@main with: key: ${{ github.job }} save: ${{ vars.BRANCHES_TO_BE_CACHED == '' || contains(vars.BRANCHES_TO_BE_CACHED, github.ref) }} - name: Build shell: bash run: make - name: Bundle static library shell: bash run: | make gather-libs - name: Deploy shell: bash env: AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }} run: | python3 scripts/amalgamation.py zip -r -j static-libs-osx-${{ matrix.architecture }}.zip src/include/duckdb.h build/release/libs/ ./scripts/upload-assets-to-staging.sh github_release static-libs-osx-${{ matrix.architecture }}.zip - uses: actions/upload-artifact@v4 with: name: duckdb-static-libs-osx-${{ matrix.architecture }} path: | static-libs-osx-${{ matrix.architecture }}.zip bundle-mingw-static-lib: name: Windows MingW static libs runs-on: windows-latest env: ENABLE_EXTENSION_AUTOLOADING: 1 ENABLE_EXTENSION_AUTOINSTALL: 1 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{ inputs.git_ref }} - uses: actions/setup-python@v5 with: python-version: '3.12' - uses: r-lib/actions/setup-r@v2 with: r-version: 'devel' update-rtools: true rtools-version: '42' # linker bug in 43 ^^ # TODO: this action is deprecated, can we rework this to avoid using it? - uses: ./.github/actions/build_extensions with: duckdb_arch: windows_amd64_mingw vcpkg_target_triplet: x64-mingw-static treat_warn_as_error: 0 override_cc: gcc override_cxx: g++ vcpkg_build: 1 no_static_linking: 0 run_tests: 0 run_autoload_tests: 0 build_in_tree_extensions: 0 build_out_of_tree_extensions: 0 bundle_static_lib_mode: 1 - name: Bundle static library shell: bash run: | make gather-libs - name: Deploy shell: bash env: AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }} run: | zip -r -j static-libs-windows-mingw.zip src/include/duckdb.h build/release/libs/ ./scripts/upload-assets-to-staging.sh github_release static-libs-windows-mingw.zip - uses: actions/upload-artifact@v4 with: name: duckdb-static-libs-windows-mingw path: | static-libs-windows-mingw.zip bundle-linux-static-libs: strategy: fail-fast: false matrix: config: [ { runner: ubuntu-latest, arch: amd64, image: x86_64 }, { runner: ubuntu-24.04-arm, arch: arm64, image: aarch64 } ] name: Linux Static Libraries (${{ matrix.config.arch }}) runs-on: ${{ matrix.config.runner }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{ inputs.git_ref }} - name: Build shell: bash run: | export PWD=`pwd` docker run \ -v$PWD:$PWD \ -e CMAKE_BUILD_PARALLEL_LEVEL=2 \ -e OVERRIDE_GIT_DESCRIBE=$OVERRIDE_GIT_DESCRIBE \ -e EXTENSION_CONFIGS="$PWD/.github/config/bundled_extensions.cmake" \ -e ENABLE_EXTENSION_AUTOLOADING=1 \ -e ENABLE_EXTENSION_AUTOINSTALL=1 \ -e BUILD_BENCHMARK=1 \ -e FORCE_WARN_UNUSED=1 \ -e EXPORT_DYNAMIC_SYMBOLS=1 \ quay.io/pypa/manylinux_2_28_${{ matrix.config.image }} \ bash -c " set -e yum install -y perl-IPC-Cmd gcc-toolset-12 gcc-toolset-12-gcc-c++ source /opt/rh/gcc-toolset-12/enable export CC=gcc export CXX=g++ git config --global --add safe.directory $PWD make gather-libs -C $PWD " - name: Print platform shell: bash run: ./build/release/duckdb -c "PRAGMA platform;" - name: Deploy shell: bash env: AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }} run: | python3 scripts/amalgamation.py zip -r -j static-libs-linux-${{ matrix.config.arch }}.zip src/include/duckdb.h build/release/libs/ ./scripts/upload-assets-to-staging.sh github_release static-libs-linux-${{ matrix.config.arch }}.zip - uses: actions/upload-artifact@v4 with: name: duckdb-static-libs-linux-${{ matrix.config.arch }} path: | static-libs-linux-${{ matrix.config.arch }}.zip