Skip to content

fix(ci): make deploy workflows self-bootstrapping#30

Merged
avallete merged 1 commit into
masterfrom
fix/ci-deploy-self-bootstrap
May 12, 2026
Merged

fix(ci): make deploy workflows self-bootstrapping#30
avallete merged 1 commit into
masterfrom
fix/ci-deploy-self-bootstrap

Conversation

@avallete
Copy link
Copy Markdown
Member

Context

After merging #29, both deploy-pg.yml and deploy-pg-protocol.yml failed at the Install dependencies step:

error Couldn't find any versions for "@supabase/pg-protocol" that matches "^1.13.0"

Root cause (chicken-and-egg)

Both workflows ran yarn install --frozen-lockfile from the workspace root. That triggers resolution for every workspace package — including the pg-protocol: npm:@supabase/pg-protocol@^1.13.0 alias declared in packages/pg/package.json. The latest published @supabase/pg-protocol was 1.8.0, so resolution failed before either workflow could publish anything. The two workflows ran in parallel on the same merge commit and both died at install.

This will recur on every future bump of pg-protocol if not fixed at the workflow level.

Fix: scope each workflow to its own package

deploy-pg-protocol.yml

pg-protocol is a leaf TypeScript package — no runtime deps, only TS toolchain devDeps. Install + build + publish runs inside packages/pg-protocol/ only. Uses npm install --workspaces=false --prefix . so npm does not walk up to the workspace root package.json (verified locally: without the flags, npm pulls in the root devDeps and hits an @typescript-eslint/eslint-plugin peer conflict).

deploy-pg.yml

pg is plain JavaScript — no build step (esm/index.mjs is hand-written). npm publish packs from the files field without resolving any dependencies. Drop the install step entirely and just cd packages/pg && npm publish.

Also extended each workflow's paths trigger to include the workflow file itself, so future tweaks are testable without an unrelated source change.

Test plan

Verified locally (packages/pg-protocol): npm install --workspaces=false --prefix . && npm run build produces dist/, and npm publish --dry-run lists the expected 42 files / 36.1 kB tarball.

Verified locally (packages/pg): npm publish --dry-run (no install) lists the expected 21 files / 25.6 kB tarball.

After merge: trigger both workflows manually via workflow_dispatch to publish the still-pending @supabase/pg-protocol@1.13.0 and @supabase/pg@8.20.0 from the previous merge.

Both deploy workflows ran `yarn install --frozen-lockfile` from the
workspace root, which tries to resolve every workspace package's
dependencies — including the `pg-protocol: npm:@supabase/pg-protocol@
^X.Y.Z` alias declared in packages/pg/package.json. Any time we bump
pg-protocol to a new version, install fails because the new version
isn't on npm yet (deploy-pg-protocol.yml is the workflow that's
*about to* publish it). The same workflow on the same merge commit
fired in parallel for pg and both jobs died at install before they
could publish anything.

Fix: run install/build/publish strictly inside each package directory.

- deploy-pg-protocol.yml: pg-protocol is a leaf TypeScript package
  with no runtime deps and only TS toolchain devDeps. We can install
  + build + publish inside packages/pg-protocol/ in full isolation.
  Use `npm install --workspaces=false --prefix .` so npm doesn't walk
  up to the workspace root package.json (verified locally — without
  these flags npm still pulls in the root deps and hits an ESLint
  peer-dep conflict).

- deploy-pg.yml: pg is plain JavaScript — there is no build step
  (esm/index.mjs is hand-written) and `npm publish` packs straight
  from the `files` field without resolving any dependencies. So we
  drop the install step entirely and just `cd packages/pg && npm
  publish`.

Both workflows still trigger on push to master with their existing
paths filter; we additionally trigger on changes to the workflow file
itself so future workflow tweaks are testable end-to-end without an
unrelated source-file change.
@avallete avallete closed this May 12, 2026
@avallete avallete reopened this May 12, 2026
@avallete avallete closed this May 12, 2026
@avallete avallete reopened this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants