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}`);