From 36a96b6aba071dd3afd8d87f30cc5c93b721aaab Mon Sep 17 00:00:00 2001 From: Pawel Kosiec Date: Thu, 30 Apr 2026 14:44:09 +0200 Subject: [PATCH] fix(lakebase): sync version to package.json before packing tarball release-it with "npm": false skips the version bump in package.json, causing the tarball to contain the old version while VERSION file has the new one. Add sync-lakebase-version.ts (mirroring sync-versions.ts for appkit) and call it in the prepare-release workflow. Co-authored-by: Isaac --- .../workflows/prepare-release-lakebase.yml | 5 ++++ packages/lakebase/package.json | 2 +- tools/sync-lakebase-version.ts | 26 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tools/sync-lakebase-version.ts diff --git a/.github/workflows/prepare-release-lakebase.yml b/.github/workflows/prepare-release-lakebase.yml index 33f1a52c1..dabebf9fa 100644 --- a/.github/workflows/prepare-release-lakebase.yml +++ b/.github/workflows/prepare-release-lakebase.yml @@ -60,6 +60,11 @@ jobs: working-directory: packages/lakebase run: | pnpm exec release-it ${{ steps.version.outputs.version }} --ci + + - name: Sync version + if: steps.version.outputs.version != '' + run: pnpm exec tsx tools/sync-lakebase-version.ts "${{ steps.version.outputs.version }}" + - name: Build if: steps.version.outputs.version != '' run: pnpm --filter=@databricks/lakebase build:package diff --git a/packages/lakebase/package.json b/packages/lakebase/package.json index 5f8c73216..761e155ad 100644 --- a/packages/lakebase/package.json +++ b/packages/lakebase/package.json @@ -2,7 +2,7 @@ "name": "@databricks/lakebase", "type": "module", "version": "0.2.0", - "description": "PostgreSQL driver for Databricks Lakebase with automatic OAuth token refresh", + "description": "PostgreSQL driver for Databricks Lakebase Autoscaling with automatic OAuth token refresh", "main": "./dist/index.js", "types": "./dist/index.d.ts", "packageManager": "pnpm@10.21.0", diff --git a/tools/sync-lakebase-version.ts b/tools/sync-lakebase-version.ts new file mode 100644 index 000000000..0bdff3ead --- /dev/null +++ b/tools/sync-lakebase-version.ts @@ -0,0 +1,26 @@ +#!/usr/bin/env tsx +/** + * Syncs the version to the lakebase package. + * Used by the prepare-release-lakebase workflow after version bump. + */ + +/** + * NOTE: This script is also used by the private secure release repo + * during the finalize step. Changes here affect the release pipeline. + */ + +import { readFileSync, writeFileSync } from "node:fs"; +import { join } from "node:path"; + +const ROOT = process.cwd(); +const version = process.argv[2]; +if (!version) { + console.error("Usage: sync-lakebase-version.ts "); + process.exit(1); +} + +const pkgJsonPath = join(ROOT, "packages/lakebase/package.json"); +const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8")); +pkgJson.version = version; +writeFileSync(pkgJsonPath, `${JSON.stringify(pkgJson, null, 2)}\n`); +console.log(`✓ packages/lakebase/package.json → ${version}`);