Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish to duckdb node neo #4

Merged
merged 13 commits into from
Aug 10, 2024
90 changes: 87 additions & 3 deletions .github/workflows/NodeJS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,52 @@ on:
push:
pull_request:
workflow_dispatch:
inputs:
publish_dry_run:
description: 'Publish Dry Run'
type: boolean
required: true
default: true
linux:
description: 'Run on Linux'
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)'
type: boolean
required: true
default: false
publish_api:
description: 'Publish API (from Linux)'
type: boolean
required: true
default: false
macos:
description: 'Run on Mac OS'
type: boolean
required: true
default: false
publish_darwin_arm64:
description: 'Publish Bindings for Darwin ARM64'
type: boolean
required: true
default: false
windows:
description: 'Run on Windows'
type: boolean
required: true
default: false
publish_win32_x64:
description: 'Publish Bindings for Win32 x64'
type: boolean
required: true
default: false
repository_dispatch:

concurrency:
Expand All @@ -11,9 +57,10 @@ concurrency:

jobs:

linux-nodejs:
linux:
name: Linux
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_dispatch' || inputs.linux }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -42,10 +89,32 @@ jobs:
- name: API - Test
working-directory: alt/api
run: pnpm test

- name: Publish - Bindings - Linux x64
if: ${{ inputs.publish_linux_x64 }}
working-directory: alt/bindings/pkgs/@duckdb/node-bindings-linux-x64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish - Bindings
if: ${{ inputs.publish_bindings }}
working-directory: alt/bindings/pkgs/@duckdb/node-bindings
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish - API
if: ${{ inputs.publish_api }}
working-directory: alt/api/pkgs/@duckdb/node-api
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

osx-nodejs:
macos:
name: Mac OS X
runs-on: macos-latest
if: ${{ github.event_name != 'workflow_dispatch' || inputs.macos }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -74,10 +143,18 @@ jobs:
- name: API - Test
working-directory: alt/api
run: pnpm test

- name: Publish - Bindings - Darwin ARM64
if: ${{ inputs.publish_darwin_arm64 }}
working-directory: alt/bindings/pkgs/@duckdb/node-bindings-darwin-arm64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

win-nodejs:
windows:
name: Windows
runs-on: windows-latest
if: ${{ github.event_name != 'workflow_dispatch' || inputs.windows }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -106,3 +183,10 @@ jobs:
- name: API - Test
working-directory: alt/api
run: pnpm test

- name: Publish - Bindings - Win32 x64
if: ${{ inputs.publish_win32_x64 }}
working-directory: alt/bindings/pkgs/@duckdb/node-bindings-win32-x64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions alt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DuckDB Node Bindings & API
2 changes: 1 addition & 1 deletion alt/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test:watch": "vitest"
},
"dependencies": {
"@jraymakers/duckdb-node-bindings": "workspace:*"
"@duckdb/node-bindings": "workspace:*"
},
"devDependencies": {
"@types/node": "^20.14.12",
Expand Down
3 changes: 2 additions & 1 deletion alt/api/pkgs/@duckdb/node-api/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@jraymakers:registry=https://npm.pkg.github.com
@duckdb:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}
1 change: 1 addition & 0 deletions alt/api/pkgs/@duckdb/node-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DuckDB Node API
6 changes: 3 additions & 3 deletions alt/api/pkgs/@duckdb/node-api/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@jraymakers/duckdb-node-api",
"name": "@duckdb/node-api",
"version": "0.0.2",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"dependencies": {
"@jraymakers/duckdb-node-bindings": "workspace:*"
"@duckdb/node-bindings": "workspace:*"
},
"repository": {
"type": "git",
"url": "https://github.com/jraymakers/duckdb-node-packages.git"
"url": "https://github.com/duckdb/duckdb-node-neo.git"
}
}
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBAppender.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';

export class DuckDBAppender {
private readonly appender: duckdb.Appender;
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBConnection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { DuckDBAppender } from './DuckDBAppender';
import { DuckDBExtractedStatements } from './DuckDBExtractedStatements';
import { DuckDBInstance } from './DuckDBInstance';
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBDataChunk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { DuckDBVector } from './DuckDBVector';

export class DuckDBDataChunk {
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBExtractedStatements.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { DuckDBPreparedStatement } from './DuckDBPreparedStatement';

export class DuckDBExtractedStatements {
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBInstance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { DuckDBConnection } from './DuckDBConnection';

export class DuckDBInstance {
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBLogicalType.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import {
DuckDBArrayType,
DuckDBBigIntType,
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBPendingResult.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { DuckDBResult } from './DuckDBResult';

// Values match similar enum in C API.
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBPreparedStatement.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { DuckDBPendingResult } from './DuckDBPendingResult';
import { DuckDBResult } from './DuckDBResult';
import { DuckDBTypeId } from './DuckDBTypeId';
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBResult.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { DuckDBDataChunk } from './DuckDBDataChunk';
import { DuckDBLogicalType } from './DuckDBLogicalType';
import { DuckDBType } from './DuckDBType';
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/DuckDBVector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from 'os';
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { DuckDBLogicalType } from './DuckDBLogicalType';
import {
DuckDBArrayType,
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/configurationOptionDescriptions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';

export function configurationOptionDescriptions(): Readonly<
Record<string, string>
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/throwOnFailure.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';

export function throwOnFailure(state: duckdb.State, message: string, getError?: () => string, dispose?: () => void) {
if (state !== duckdb.State.Success) {
Expand Down
2 changes: 1 addition & 1 deletion alt/api/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';

export function version(): string {
return duckdb.library_version();
Expand Down
2 changes: 1 addition & 1 deletion alt/bindings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test:watch": "vitest"
},
"dependencies": {
"@jraymakers/duckdb-node-bindings": "workspace:*",
"@duckdb/node-bindings": "workspace:*",
"node-addon-api": "^8.0.0",
"node-gyp": "^10.1.0",
"rimraf": "^5.0.7",
Expand Down
3 changes: 2 additions & 1 deletion alt/bindings/pkgs/@duckdb/node-bindings-darwin-arm64/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@jraymakers:registry=https://npm.pkg.github.com
@duckdb:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DuckDB Node Bindings: Darwin ARM64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jraymakers/duckdb-node-bindings-darwin-arm64",
"version": "0.0.1",
"name": "@duckdb/node-bindings-darwin-arm64",
"version": "0.0.2",
"os": [
"darwin"
],
Expand All @@ -9,6 +9,6 @@
],
"repository": {
"type": "git",
"url": "https://github.com/jraymakers/duckdb-node-packages.git"
"url": "https://github.com/duckdb/duckdb-node-neo.git"
}
}
3 changes: 2 additions & 1 deletion alt/bindings/pkgs/@duckdb/node-bindings-linux-x64/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@jraymakers:registry=https://npm.pkg.github.com
@duckdb:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DuckDB Node Bindings: Linux x64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jraymakers/duckdb-node-bindings-linux-x64",
"version": "0.0.1",
"name": "@duckdb/node-bindings-linux-x64",
"version": "0.0.2",
"os": [
"linux"
],
Expand All @@ -9,6 +9,6 @@
],
"repository": {
"type": "git",
"url": "https://github.com/jraymakers/duckdb-node-packages.git"
"url": "https://github.com/duckdb/duckdb-node-neo.git"
}
}
3 changes: 2 additions & 1 deletion alt/bindings/pkgs/@duckdb/node-bindings-win32-x64/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@jraymakers:registry=https://npm.pkg.github.com
@duckdb:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DuckDB Node Bindings: Win32 x64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jraymakers/duckdb-node-bindings-win32-x64",
"version": "0.0.1",
"name": "@duckdb/node-bindings-win32-x64",
"version": "0.0.2",
"os": [
"win32"
],
Expand All @@ -9,6 +9,6 @@
],
"repository": {
"type": "git",
"url": "https://github.com/jraymakers/duckdb-node-packages.git"
"url": "https://github.com/duckdb/duckdb-node-neo.git"
}
}
3 changes: 2 additions & 1 deletion alt/bindings/pkgs/@duckdb/node-bindings/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@jraymakers:registry=https://npm.pkg.github.com
@duckdb:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}
1 change: 1 addition & 0 deletions alt/bindings/pkgs/@duckdb/node-bindings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DuckDB Node Bindings
2 changes: 1 addition & 1 deletion alt/bindings/pkgs/@duckdb/node-bindings/duckdb.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require(`@jraymakers/duckdb-node-bindings-${process.platform}-${process.arch}/duckdb.node`);
module.exports = require(`@duckdb/node-bindings-${process.platform}-${process.arch}/duckdb.node`);
12 changes: 6 additions & 6 deletions alt/bindings/pkgs/@duckdb/node-bindings/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@jraymakers/duckdb-node-bindings",
"version": "0.0.1",
"name": "@duckdb/node-bindings",
"version": "0.0.2",
"main": "./duckdb.js",
"types": "./duckdb.d.ts",
"optionalDependencies": {
"@jraymakers/duckdb-node-bindings-darwin-arm64": "workspace:*",
"@jraymakers/duckdb-node-bindings-linux-x64": "workspace:*",
"@jraymakers/duckdb-node-bindings-win32-x64": "workspace:*"
"@duckdb/node-bindings-darwin-arm64": "workspace:*",
"@duckdb/node-bindings-linux-x64": "workspace:*",
"@duckdb/node-bindings-win32-x64": "workspace:*"
},
"repository": {
"type": "git",
"url": "https://github.com/jraymakers/duckdb-node-packages.git"
"url": "https://github.com/duckdb/duckdb-node-neo.git"
}
}
2 changes: 1 addition & 1 deletion alt/bindings/test/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { expect, suite, test } from 'vitest';

suite('config', () => {
Expand Down
2 changes: 1 addition & 1 deletion alt/bindings/test/enums.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { expect, suite, test } from 'vitest';

suite('enums', () => {
Expand Down
2 changes: 1 addition & 1 deletion alt/bindings/test/errors.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { expect, suite, test } from 'vitest';

suite('errors', () => {
Expand Down
2 changes: 1 addition & 1 deletion alt/bindings/test/functions.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { expect, suite, test } from 'vitest';

suite('functions', () => {
Expand Down
2 changes: 1 addition & 1 deletion alt/bindings/test/logical_type.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { expect, suite, test } from 'vitest';

suite('logical_type', () => {
Expand Down
2 changes: 1 addition & 1 deletion alt/bindings/test/open.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { expect, suite, test } from 'vitest';

suite('open', () => {
Expand Down
2 changes: 1 addition & 1 deletion alt/bindings/test/query.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import duckdb from '@jraymakers/duckdb-node-bindings';
import duckdb from '@duckdb/node-bindings';
import { expect, suite, test } from 'vitest';

function isValid(validity: BigUint64Array, bit: number): boolean {
Expand Down
Loading