forked from brianc/node-postgres
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (58 loc) · 2.53 KB
/
deploy-pg-protocol.yml
File metadata and controls
66 lines (58 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Deploy pg-protocol package
on:
push:
branches:
- master
paths:
- 'packages/pg-protocol/**'
- '.github/workflows/deploy-pg-protocol.yml'
workflow_dispatch:
inputs:
version:
description: 'Version to publish (optional)'
required: false
type: string
permissions:
contents: read
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
# IMPORTANT: install/build/publish strictly inside packages/pg-protocol/
# to avoid touching the workspace root. The root yarn.lock contains the
# `pg-protocol: npm:@supabase/pg-protocol@^X.Y.Z` alias, which would fail
# resolution any time we bump pg-protocol's version (the new version is
# not on npm yet — that's exactly what this workflow is publishing).
# pg-protocol has no runtime deps and only TS toolchain devDeps, so
# `npm install` inside the package directory is fully self-contained.
defaults:
run:
working-directory: packages/pg-protocol
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install pg-protocol devDependencies (isolated, no workspace root)
# --workspaces=false + --prefix . is required to stop npm from
# walking up to the workspace root package.json. Without it, npm
# tries to resolve every workspace package's deps and trips on
# the unpublished `@supabase/pg-protocol@^X.Y.Z` alias in pg.
# --ignore-scripts skips lifecycle hooks (we run build explicitly
# below) so a stale tsbuildinfo can never produce an empty dist/.
run: yarn install --no-package-lock --no-audit --no-fund --workspaces=false --ignore-scripts --prefix .
- name: Build package (clean rebuild)
# `npm run build` triggers `prebuild` which removes any stale
# `dist/` and `tsconfig.tsbuildinfo`. Without the clean step a
# checked-in tsbuildinfo (or one left by a previous run) would
# make `tsc --incremental` exit successfully with zero output —
# producing a broken tarball with no compiled code. See the
# 1.13.1 incident.
run: yarn run build
# Ensure npm 11.5.1 or later is installed for trusted publishing support
- name: Update npm
run: npm install -g npm@latest
- name: Publish to npm
run: npm publish