Skip to content

allow unsupported platform when duckdb.node present #414

allow unsupported platform when duckdb.node present

allow unsupported platform when duckdb.node present #414

name: DuckDB Node Bindings & API
on:
pull_request:
workflow_dispatch:
inputs:
publish:
description: 'Publish'
type: boolean
required: true
default: false
publish_dry_run:
description: 'Publish Dry Run'
type: boolean
required: true
default: true
linux_x64:
description: 'Run on Linux x64'
type: boolean
required: true
default: false
# publish_linux_x64:
# description: 'Publish Bindings for Linux x64'
# type: boolean
# required: true
# default: false
# publish_bindings:
# description: 'Publish Bindings (from Linux x64)'
# type: boolean
# required: true
# default: false
# publish_api:
# description: 'Publish API (from Linux x64)'
# type: boolean
# required: true
# default: false
linux_arm64:
description: 'Run on Linux arm64'
type: boolean
required: true
default: false
# publish_linux_arm64:
# description: 'Publish Bindings for Linux arm64'
# type: boolean
# required: true
# default: false
macos_arm64:
description: 'Run on Mac OS X arm64'
type: boolean
required: true
default: false
# publish_darwin_arm64:
# description: 'Publish Bindings for Darwin arm64'
# type: boolean
# required: true
# default: false
macos_x64:
description: 'Run on Mac OS X x64'
type: boolean
required: true
default: false
windows_x64:
description: 'Run on Windows x64'
type: boolean
required: true
default: false
# publish_win32_x64:
# description: 'Publish Bindings for Win32 x64'
# type: boolean
# required: true
# default: false
repository_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
cancel-in-progress: false
jobs:
linux_x64:
name: Linux x64
runs-on: ubuntu-24.04
container:
image: quay.io/pypa/manylinux_2_28_x86_64
permissions:
contents: read
id-token: write # for OIDC, for trusted publishing
if: ${{ github.event_name != 'workflow_dispatch' || inputs.linux_x64 }}
steps:
# - name: find stdc++ lib location
# run: /sbin/ldconfig -p | grep stdc++
# - name: check LIBCXX strings in libstdc++
# run: strings /lib64/libstdc++.so.6 | grep LIBCXX
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Record Node directory
run: echo "NODE_DIR=$(dirname $(dirname $(which node)))" >> "$GITHUB_ENV"
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Workspace - Install
run: pnpm install --ignore-scripts
- name: Bindings - Build
working-directory: bindings
run: pnpm run build
- name: Bindings - Test
working-directory: bindings
run: pnpm test
- name: API - Build
working-directory: api
run: pnpm run build
- name: API - Test
working-directory: api
run: pnpm test
# - name: Git Status
# if: ${{ inputs.publish }}
# run: git status
- name: Publish - Bindings - Linux x64
if: ${{ inputs.publish }}
working-directory: bindings/pkgs/@duckdb/node-bindings-linux-x64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public --tag latest
- name: Publish - Bindings
if: ${{ inputs.publish }}
working-directory: bindings/pkgs/@duckdb/node-bindings
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public --tag latest
- name: Publish - API
if: ${{ inputs.publish }}
working-directory: api/pkgs/@duckdb/node-api
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public --tag latest
linux_arm64:
name: Linux arm64
runs-on: ubuntu-24.04-arm
container:
image: quay.io/pypa/manylinux_2_28_aarch64
permissions:
contents: read
id-token: write # for OIDC, for trusted publishing
if: ${{ github.event_name != 'workflow_dispatch' || inputs.linux_arm64 }}
steps:
# - name: find stdc++ lib location
# run: /sbin/ldconfig -p | grep stdc++
# - name: check LIBCXX strings in libstdc++
# run: strings /lib64/libstdc++.so.6 | grep LIBCXX
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Record Node directory
run: echo "NODE_DIR=$(dirname $(dirname $(which node)))" >> "$GITHUB_ENV"
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Workspace - Install
run: pnpm install --ignore-scripts
- name: Bindings - Build
working-directory: bindings
run: pnpm run build
- name: Bindings - Test
working-directory: bindings
run: pnpm test
# - name: Git Status
# if: ${{ inputs.publish }}
# run: git status
- name: Publish - Bindings - Linux arm64
if: ${{ inputs.publish }}
working-directory: bindings/pkgs/@duckdb/node-bindings-linux-arm64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public --tag latest
macos_arm64:
name: Mac OS X arm64
runs-on: macos-15
permissions:
contents: read
id-token: write # for OIDC, for trusted publishing
if: ${{ github.event_name != 'workflow_dispatch' || inputs.macos_arm64 }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Record Node directory
run: echo "NODE_DIR=$(dirname $(dirname $(which node)))" >> "$GITHUB_ENV"
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Workspace - Install
run: pnpm install --ignore-scripts
- name: Bindings - Build
working-directory: bindings
run: pnpm run build
- name: Bindings - Test
working-directory: bindings
run: pnpm test
- name: API - Build
working-directory: api
run: pnpm run build
- name: API - Test
working-directory: api
run: pnpm test
- name: Git Status
if: ${{ inputs.publish }}
run: git status
- name: Publish - Bindings - Darwin arm64
if: ${{ inputs.publish }}
working-directory: bindings/pkgs/@duckdb/node-bindings-darwin-arm64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public --tag latest
macos_x64:
name: Mac OS X x64
runs-on: macos-15-intel
permissions:
contents: read
id-token: write # for OIDC, for trusted publishing
if: ${{ github.event_name != 'workflow_dispatch' || inputs.macos_x64 }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Record Node directory
run: echo "NODE_DIR=$(dirname $(dirname $(which node)))" >> "$GITHUB_ENV"
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Workspace - Install
run: pnpm install --ignore-scripts
- name: Bindings - Build
working-directory: bindings
run: pnpm run build
- name: Bindings - Test
working-directory: bindings
run: pnpm test
- name: API - Build
working-directory: api
run: pnpm run build
- name: API - Test
working-directory: api
run: pnpm test
- name: Git Status
if: ${{ inputs.publish }}
run: git status
- name: Publish - Bindings - Darwin x64
if: ${{ inputs.publish }}
working-directory: bindings/pkgs/@duckdb/node-bindings-darwin-x64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public --tag latest
windows_x64:
name: Windows x64
runs-on: windows-2025
permissions:
contents: read
id-token: write # for OIDC, for trusted publishing
if: ${{ github.event_name != 'workflow_dispatch' || inputs.windows_x64 }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Record Node directory
shell: bash
run: echo "NODE_DIR=D:\\a\\node-v24.10.0" >> "$GITHUB_ENV"
- name: Cache Node directory
id: cache-node-dir
uses: actions/cache@v4
with:
path: D:\\a\\node-v24.10.0
key: node-dir-v24.10.0-win-x64
- name: Download Node headers
if: steps.cache-node-dir.outputs.cache-hit != 'true'
shell: bash
run: curl -sSL "https://nodejs.org/download/release/v24.10.0/node-v24.10.0-headers.tar.gz" -o "D:/a/node-v24.10.0-headers.tar.gz"
- name: Extract Node headers
if: steps.cache-node-dir.outputs.cache-hit != 'true'
run: tar -xzf D:\a\node-v24.10.0-headers.tar.gz -C D:\a
- name: Download Node lib
if: steps.cache-node-dir.outputs.cache-hit != 'true'
shell: bash
run: curl -sSL "https://nodejs.org/download/release/v24.10.0/win-x64/node.lib" --create-dirs -o "$NODE_DIR/Release/node.lib"
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Workspace - Install
run: pnpm install --ignore-scripts
- name: Bindings - Build
working-directory: bindings
run: pnpm run build
- name: Bindings - Test
working-directory: bindings
run: pnpm test
- name: API - Build
working-directory: api
run: pnpm run build
- name: API - Test
working-directory: api
run: pnpm test
- name: Git Status
if: ${{ inputs.publish }}
run: git status
- name: Publish - Bindings - Win32 x64
if: ${{ inputs.publish }}
working-directory: bindings/pkgs/@duckdb/node-bindings-win32-x64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public --tag latest