Skip to content
Closed
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,30 @@ jobs:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24.x'

- name: Create and verify npm packages
run: |
VERSION="${{ fromJSON(steps.gorelease-snapshot.outputs.metadata).version }}"
for platform in darwin-amd64 darwin-arm64 linux-amd64 linux-arm64; do
node packages/npm/scripts/create_packages.js \
--version "$VERSION" \
--platform "$platform" \
--archive "dist/dbc-${platform}-${VERSION}.tar.gz"
done
node packages/npm/scripts/create_packages.js \
--version "$VERSION" \
--platform windows-amd64 \
--archive "dist/dbc-windows-amd64-${VERSION}.zip"

# Verify we can install
cd packages/npm/wrapper
npm install ../packages/dbc-linux-x64
npm install
node bin/dbc.js --version

- name: Upload Snapshot Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
Expand All @@ -107,6 +131,8 @@ jobs:
dist/*.rpm
dist/msi/**/*.msi
dist/python/*
packages/npm/packages/*/
packages/npm/wrapper/

production_deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -249,3 +275,47 @@ jobs:
--value="${RELEASE_VERSION}"
env:
RELEASE_VERSION: ${{ fromJSON(steps.gorelease.outputs.metadata).version }}

publish_npm:
runs-on: ubuntu-latest
environment: production
needs: production_deploy
if: github.event_name == 'push'
permissions:
contents: read
id-token: write # For npm provenance
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'

- name: Publish to npm
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}" # strip leading 'v'

# Create packages for all platforms from the release we just published
node packages/npm/scripts/create_packages.js --version "$VERSION"

# Handle pre-releases: Prereleases (e.g. 0.3.0-rc1) publish under
# 'next' so they don't become the default for 'npm install
# @columnar-tech/dbc'
if echo "$VERSION" | grep -q '-'; then
NPM_TAG="next"
else
NPM_TAG="latest"
fi

# Make sure to upload the platform-specific packages before the
# wrapper since they're deps
for pkg in packages/npm/packages/*/; do
npm publish "$pkg" --provenance --access public --tag "$NPM_TAG"
done
npm publish packages/npm/wrapper --provenance --access public --tag "$NPM_TAG"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 9 additions & 0 deletions packages/npm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules/

# Files generated by scripts/create_packages.js — not committed
packages/*/bin/dbc*
packages/*/package.json
packages/*/README.md
packages/*/LICENSE
wrapper/package.json
wrapper/LICENSE
27 changes: 27 additions & 0 deletions packages/npm/packages/README.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
Copyright 2026 Columnar Technologies Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# @columnar-tech/dbc-PLATFORM_SUFFIX

This package contains the `PLATFORM_SUFFIX` binary for [`@columnar-tech/dbc`](https://www.npmjs.com/package/@columnar-tech/dbc).

**Do not install this package directly.** Install the wrapper instead:

```sh
npm install -g @columnar-tech/dbc
```

This package is automatically selected by npm based on your operating system and CPU architecture.
62 changes: 62 additions & 0 deletions packages/npm/platforms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2026 Columnar Technologies Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

"use strict";

// Add a new entry here to support a new platform across both the
// build script (create_packages.js) and the wrapper shim (bin/dbc.js).
const PLATFORMS = [
{
goosArch: "darwin-arm64",
npmPkg: "@columnar-tech/dbc-darwin-arm64",
description: "macOS arm64 binary for dbc, the CLI for installing ADBC drivers",
binary: "dbc",
os: "darwin",
cpu: "arm64",
},
{
goosArch: "darwin-amd64",
npmPkg: "@columnar-tech/dbc-darwin-x64",
description: "macOS x64 binary for dbc, the CLI for installing ADBC drivers",
binary: "dbc",
os: "darwin",
cpu: "x64",
},
{
goosArch: "linux-arm64",
npmPkg: "@columnar-tech/dbc-linux-arm64",
description: "Linux arm64 binary for dbc, the CLI for installing ADBC drivers",
binary: "dbc",
os: "linux",
cpu: "arm64",
},
{
goosArch: "linux-amd64",
npmPkg: "@columnar-tech/dbc-linux-x64",
description: "Linux x64 binary for dbc, the CLI for installing ADBC drivers",
binary: "dbc",
os: "linux",
cpu: "x64",
},
{
goosArch: "windows-amd64",
npmPkg: "@columnar-tech/dbc-win32-x64",
description: "Windows x64 binary for dbc, the CLI for installing ADBC drivers",
binary: "dbc.exe",
os: "win32",
cpu: "x64",
},
];

module.exports = { PLATFORMS };
Loading
Loading