pgserve 2.1.3 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/README.md +105 -1
- package/bin/autopg-wrapper.cjs +16 -0
- package/bin/pgserve-wrapper.cjs +32 -6
- package/bin/postgres-server.js +56 -0
- package/console/README.md +131 -0
- package/console/api.js +173 -0
- package/console/app.jsx +483 -0
- package/console/colors_and_type.css +227 -0
- package/console/components.jsx +167 -0
- package/console/console.css +1666 -0
- package/console/data.jsx +350 -0
- package/console/index.html +31 -0
- package/console/screens/databases.jsx +5 -0
- package/console/screens/health.jsx +5 -0
- package/console/screens/ingress.jsx +5 -0
- package/console/screens/optimizer.jsx +5 -0
- package/console/screens/rlm-sim.jsx +5 -0
- package/console/screens/rlm-trace.jsx +5 -0
- package/console/screens/security.jsx +5 -0
- package/console/screens/settings.jsx +611 -0
- package/console/screens/sql.jsx +5 -0
- package/console/screens/sync.jsx +5 -0
- package/console/screens/tables.jsx +5 -0
- package/console/tweaks-panel.jsx +425 -0
- package/package.json +14 -2
- package/scripts/postinstall.cjs +60 -0
- package/src/cli-config.cjs +310 -0
- package/src/cli-install.cjs +112 -11
- package/src/cli-restart.cjs +228 -0
- package/src/cli-ui.cjs +580 -0
- package/src/cluster.js +43 -38
- package/src/postgres.js +141 -19
- package/src/settings-loader.cjs +235 -0
- package/src/settings-migrate.cjs +212 -0
- package/src/settings-pg-args.cjs +146 -0
- package/src/settings-schema.cjs +422 -0
- package/src/settings-validator.cjs +416 -0
- package/src/settings-writer.cjs +288 -0
- package/src/upgrade/index.js +65 -0
- package/src/upgrade/runner.js +23 -0
- package/src/upgrade/steps/binary-cache-flush.js +67 -0
- package/src/upgrade/steps/consumer-signal.js +40 -0
- package/src/upgrade/steps/env-refresh.js +89 -0
- package/src/upgrade/steps/health-validate.js +53 -0
- package/src/upgrade/steps/plpgsql-resolve.js +66 -0
- package/src/upgrade/steps/port-reconcile.js +52 -0
- package/.claude/context/windows-debug.md +0 -119
- package/.genie/AGENTS.md +0 -15
- package/.genie/agents/README.md +0 -110
- package/.genie/agents/analyze.md +0 -176
- package/.genie/agents/forge.md +0 -290
- package/.genie/agents/garbage-cleaner.md +0 -324
- package/.genie/agents/garbage-collector.md +0 -596
- package/.genie/agents/github-issue-gc.md +0 -618
- package/.genie/agents/review.md +0 -380
- package/.genie/agents/semantic-analyzer/find-duplicates.md +0 -90
- package/.genie/agents/semantic-analyzer/find-orphans.md +0 -99
- package/.genie/agents/semantic-analyzer.md +0 -101
- package/.genie/agents/update.md +0 -182
- package/.genie/agents/wish.md +0 -357
- package/.genie/brainstorms/pgserve-v2/DESIGN.md +0 -174
- package/.genie/code/AGENTS.md +0 -694
- package/.genie/code/agents/audit/risk.md +0 -173
- package/.genie/code/agents/audit/security.md +0 -189
- package/.genie/code/agents/audit.md +0 -145
- package/.genie/code/agents/challenge.md +0 -230
- package/.genie/code/agents/change-reviewer.md +0 -295
- package/.genie/code/agents/code-garbage-collector.md +0 -425
- package/.genie/code/agents/code-quality.md +0 -410
- package/.genie/code/agents/commit-suggester.md +0 -255
- package/.genie/code/agents/commit.md +0 -124
- package/.genie/code/agents/consensus.md +0 -204
- package/.genie/code/agents/daily-standup.md +0 -722
- package/.genie/code/agents/docgen.md +0 -48
- package/.genie/code/agents/explore.md +0 -79
- package/.genie/code/agents/fix.md +0 -100
- package/.genie/code/agents/git/commit-advisory.md +0 -219
- package/.genie/code/agents/git/workflows/issue.md +0 -244
- package/.genie/code/agents/git/workflows/pr.md +0 -179
- package/.genie/code/agents/git/workflows/release.md +0 -460
- package/.genie/code/agents/git/workflows/report.md +0 -342
- package/.genie/code/agents/git.md +0 -432
- package/.genie/code/agents/implementor.md +0 -161
- package/.genie/code/agents/install.md +0 -515
- package/.genie/code/agents/issue-creator.md +0 -344
- package/.genie/code/agents/polish.md +0 -116
- package/.genie/code/agents/qa.md +0 -653
- package/.genie/code/agents/refactor.md +0 -294
- package/.genie/code/agents/release.md +0 -1129
- package/.genie/code/agents/roadmap.md +0 -885
- package/.genie/code/agents/tests.md +0 -557
- package/.genie/code/agents/tracer.md +0 -50
- package/.genie/code/agents/update/upstream-update.md +0 -85
- package/.genie/code/agents/update/versions/generic-update.md +0 -305
- package/.genie/code/agents/vibe.md +0 -1317
- package/.genie/code/spells/agent-configuration.md +0 -58
- package/.genie/code/spells/automated-rc-publishing.md +0 -106
- package/.genie/code/spells/branch-tracker-guidance.md +0 -28
- package/.genie/code/spells/debug.md +0 -320
- package/.genie/code/spells/emoji-naming-convention.md +0 -303
- package/.genie/code/spells/evidence-storage.md +0 -26
- package/.genie/code/spells/file-naming-rules.md +0 -35
- package/.genie/code/spells/forge-code-blueprints.md +0 -195
- package/.genie/code/spells/genie-integration.md +0 -153
- package/.genie/code/spells/publishing-protocol.md +0 -61
- package/.genie/code/spells/team-consultation-protocol.md +0 -284
- package/.genie/code/spells/tool-requirements.md +0 -20
- package/.genie/code/spells/triad-maintenance-protocol.md +0 -154
- package/.genie/code/teams/tech-council/council.md +0 -328
- package/.genie/code/teams/tech-council/jt.md +0 -352
- package/.genie/code/teams/tech-council/nayr.md +0 -305
- package/.genie/code/teams/tech-council/oettam.md +0 -375
- package/.genie/neurons/README.md +0 -193
- package/.genie/neurons/forge.md +0 -106
- package/.genie/neurons/genie.md +0 -63
- package/.genie/neurons/review.md +0 -106
- package/.genie/neurons/wish.md +0 -104
- package/.genie/product/README.md +0 -20
- package/.genie/product/cli-automation.md +0 -359
- package/.genie/product/environment.md +0 -60
- package/.genie/product/mission.md +0 -60
- package/.genie/product/roadmap.md +0 -44
- package/.genie/product/tech-stack.md +0 -34
- package/.genie/product/templates/context-template.md +0 -218
- package/.genie/product/templates/qa-done-report-template.md +0 -68
- package/.genie/product/templates/review-report-template.md +0 -89
- package/.genie/product/templates/wish-template.md +0 -120
- package/.genie/scripts/helpers/analyze-commit.js +0 -195
- package/.genie/scripts/helpers/bullet-counter.js +0 -194
- package/.genie/scripts/helpers/bullet-find.js +0 -289
- package/.genie/scripts/helpers/bullet-id.js +0 -244
- package/.genie/scripts/helpers/check-secrets.js +0 -237
- package/.genie/scripts/helpers/count-tokens.js +0 -200
- package/.genie/scripts/helpers/create-frontmatter.js +0 -456
- package/.genie/scripts/helpers/detect-markers.js +0 -293
- package/.genie/scripts/helpers/detect-todos.js +0 -267
- package/.genie/scripts/helpers/detect-unlabeled-blocks.js +0 -135
- package/.genie/scripts/helpers/embeddings.js +0 -344
- package/.genie/scripts/helpers/find-empty-sections.js +0 -158
- package/.genie/scripts/helpers/index.js +0 -319
- package/.genie/scripts/helpers/validate-frontmatter.js +0 -578
- package/.genie/scripts/helpers/validate-links.js +0 -207
- package/.genie/scripts/helpers/validate-paths.js +0 -373
- package/.genie/spells/README.md +0 -9
- package/.genie/spells/ace-protocol.md +0 -118
- package/.genie/spells/ask-one-at-a-time.md +0 -175
- package/.genie/spells/backup-analyzer.md +0 -542
- package/.genie/spells/blocker.md +0 -12
- package/.genie/spells/break-things-move-fast.md +0 -56
- package/.genie/spells/context-candidates.md +0 -72
- package/.genie/spells/context-critic.md +0 -51
- package/.genie/spells/defer-to-expertise.md +0 -278
- package/.genie/spells/delegate-dont-do.md +0 -292
- package/.genie/spells/error-investigation-protocol.md +0 -328
- package/.genie/spells/evidence-based-completion.md +0 -273
- package/.genie/spells/experiment.md +0 -65
- package/.genie/spells/file-creation-protocol.md +0 -229
- package/.genie/spells/forge-integration.md +0 -281
- package/.genie/spells/forge-orchestration.md +0 -514
- package/.genie/spells/gather-context.md +0 -18
- package/.genie/spells/global-health-check.md +0 -34
- package/.genie/spells/global-noop-roundtrip.md +0 -25
- package/.genie/spells/install-genie.md +0 -1232
- package/.genie/spells/install.md +0 -82
- package/.genie/spells/investigate-before-commit.md +0 -112
- package/.genie/spells/know-yourself.md +0 -288
- package/.genie/spells/learn.md +0 -828
- package/.genie/spells/mcp-diagnostic-protocol.md +0 -246
- package/.genie/spells/mcp-first.md +0 -124
- package/.genie/spells/multi-step-execution.md +0 -67
- package/.genie/spells/orchestration-boundary-protocol.md +0 -256
- package/.genie/spells/orchestrator-not-implementor.md +0 -189
- package/.genie/spells/prompt.md +0 -746
- package/.genie/spells/reflect.md +0 -404
- package/.genie/spells/routing-decision-matrix.md +0 -368
- package/.genie/spells/run-in-parallel.md +0 -12
- package/.genie/spells/session-state-updater-example.md +0 -196
- package/.genie/spells/session-state-updater.md +0 -220
- package/.genie/spells/track-long-running-tasks.md +0 -133
- package/.genie/spells/troubleshoot-infrastructure.md +0 -176
- package/.genie/spells/upgrade-genie.md +0 -415
- package/.genie/spells/url-presentation-protocol.md +0 -301
- package/.genie/spells/wish-initiation.md +0 -158
- package/.genie/spells/wish-issue-linkage.md +0 -410
- package/.genie/spells/wish-lifecycle.md +0 -100
- package/.genie/state/provider-status.json +0 -3
- package/.genie/state/version.json +0 -16
- package/.genie/wishes/canonical-pgserve-pm2-supervision/WISH.md +0 -290
- package/.genie/wishes/pgserve-v2/BRIEF-from-genie-pgserve.md +0 -99
- package/.genie/wishes/pgserve-v2/WISH.md +0 -442
- package/.genie/wishes/release-system-genie-pattern/WISH.md +0 -268
- package/.genie/wishes/release-system-genie-pattern/validation.md +0 -205
- package/.gitguardian.yaml +0 -29
- package/.gitguardianignore +0 -16
- package/.github/workflows/ci.yml +0 -122
- package/.github/workflows/release.yml +0 -289
- package/.github/workflows/version.yml +0 -228
- package/.husky/pre-commit +0 -2
- package/AGENTS.md +0 -433
- package/CLAUDE.md +0 -1
- package/Makefile +0 -285
- package/assets/icon.ico +0 -0
- package/bun.lock +0 -435
- package/bunfig.toml +0 -28
- package/ecosystem.config.cjs +0 -23
- package/eslint.config.js +0 -63
- package/examples/multi-tenant-demo.js +0 -104
- package/install.sh +0 -123
- package/knip.json +0 -9
- package/tests/audit.test.js +0 -189
- package/tests/backpressure.test.js +0 -167
- package/tests/benchmarks/runner.js +0 -1197
- package/tests/benchmarks/vector-generator.js +0 -368
- package/tests/cli-install.test.js +0 -322
- package/tests/control-db.test.js +0 -285
- package/tests/daemon-args.test.js +0 -86
- package/tests/daemon-control.test.js +0 -171
- package/tests/daemon-fingerprint-integration.test.js +0 -111
- package/tests/daemon-pr24-regression.test.js +0 -198
- package/tests/fingerprint.test.js +0 -263
- package/tests/fixtures/240-orphan-seed.sql +0 -30
- package/tests/multi-tenant.test.js +0 -374
- package/tests/orphan-cleanup.test.js +0 -390
- package/tests/pg-version-regex.test.js +0 -129
- package/tests/quick-bench.js +0 -135
- package/tests/router-handshake-retry.test.js +0 -119
- package/tests/router-handshake-watchdog.test.js +0 -110
- package/tests/sdk.test.js +0 -71
- package/tests/stale-postmaster-pid.test.js +0 -85
- package/tests/stress-test.js +0 -439
- package/tests/sync-perf-test.js +0 -150
- package/tests/tcp-listen.test.js +0 -368
- package/tests/tenancy.test.js +0 -403
- package/tests/wrapper-supervision.test.js +0 -107
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
# Single-branch release pipeline modeled on khal-os/desktop.
|
|
4
|
-
#
|
|
5
|
-
# Two trigger paths into the same workflow:
|
|
6
|
-
#
|
|
7
|
-
# 1. push to main with a hand-bumped package.json (no [skip ci] marker)
|
|
8
|
-
# -> auto-detect path: prepare reads package.json, checks if v${version}
|
|
9
|
-
# tag exists, builds + publishes + creates GitHub Release if not.
|
|
10
|
-
#
|
|
11
|
-
# 2. workflow_dispatch with bump=patch|minor|major
|
|
12
|
-
# -> bump job runs `npm version`, commits with [skip ci], tags, pushes.
|
|
13
|
-
# prepare/build/release continue inline in the same workflow run.
|
|
14
|
-
#
|
|
15
|
-
# Bot-loop guard: bump commits carry [skip ci]. Push of those commits is
|
|
16
|
-
# filtered out by the prepare gate, so the bot's own push does not retrigger.
|
|
17
|
-
#
|
|
18
|
-
# Auth: npm OIDC Trusted Publishing (configured via build-all-platforms.yml).
|
|
19
|
-
|
|
20
|
-
on:
|
|
21
|
-
push:
|
|
22
|
-
branches: [main]
|
|
23
|
-
workflow_dispatch:
|
|
24
|
-
inputs:
|
|
25
|
-
bump:
|
|
26
|
-
description: "Version bump type"
|
|
27
|
-
required: true
|
|
28
|
-
type: choice
|
|
29
|
-
options:
|
|
30
|
-
- patch
|
|
31
|
-
- minor
|
|
32
|
-
- major
|
|
33
|
-
|
|
34
|
-
concurrency:
|
|
35
|
-
group: release-${{ github.ref }}
|
|
36
|
-
cancel-in-progress: false
|
|
37
|
-
|
|
38
|
-
permissions:
|
|
39
|
-
contents: write
|
|
40
|
-
id-token: write # required so the reusable `version.yml` workflow can mint
|
|
41
|
-
# the OIDC token for npm Trusted Publishing — without this,
|
|
42
|
-
# GH rejects the workflow at parse time (startup_failure)
|
|
43
|
-
# because the called job's `id-token: write` permission
|
|
44
|
-
# exceeds what the caller has granted.
|
|
45
|
-
|
|
46
|
-
jobs:
|
|
47
|
-
# ---------------------------------------------------------------------------
|
|
48
|
-
# Bump (workflow_dispatch only): npm version, commit [skip ci], tag, push.
|
|
49
|
-
# ---------------------------------------------------------------------------
|
|
50
|
-
bump:
|
|
51
|
-
name: Bump version
|
|
52
|
-
if: github.event_name == 'workflow_dispatch'
|
|
53
|
-
runs-on: ubuntu-latest
|
|
54
|
-
timeout-minutes: 5
|
|
55
|
-
outputs:
|
|
56
|
-
version: ${{ steps.bump.outputs.version }}
|
|
57
|
-
tag: ${{ steps.bump.outputs.tag }}
|
|
58
|
-
steps:
|
|
59
|
-
- uses: actions/checkout@v4
|
|
60
|
-
with:
|
|
61
|
-
ref: main
|
|
62
|
-
fetch-depth: 0
|
|
63
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
64
|
-
|
|
65
|
-
- uses: actions/setup-node@v4
|
|
66
|
-
with:
|
|
67
|
-
node-version: "22"
|
|
68
|
-
|
|
69
|
-
- name: Configure git
|
|
70
|
-
run: |
|
|
71
|
-
git config user.name "github-actions[bot]"
|
|
72
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
73
|
-
|
|
74
|
-
- name: Bump version
|
|
75
|
-
id: bump
|
|
76
|
-
run: |
|
|
77
|
-
npm version "${{ inputs.bump }}" --no-git-tag-version
|
|
78
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
79
|
-
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
80
|
-
echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
|
|
81
|
-
echo "Bumped to ${VERSION}"
|
|
82
|
-
|
|
83
|
-
- name: Commit, tag, push
|
|
84
|
-
run: |
|
|
85
|
-
VERSION="${{ steps.bump.outputs.version }}"
|
|
86
|
-
TAG="${{ steps.bump.outputs.tag }}"
|
|
87
|
-
git add package.json
|
|
88
|
-
git commit -m "[skip ci] release ${TAG}"
|
|
89
|
-
git tag -a "${TAG}" -m "release ${TAG}"
|
|
90
|
-
git push origin HEAD --follow-tags
|
|
91
|
-
|
|
92
|
-
# ---------------------------------------------------------------------------
|
|
93
|
-
# Prepare: resolve version, skip if tag already exists, build changelog.
|
|
94
|
-
#
|
|
95
|
-
# Gate handles both event types:
|
|
96
|
-
# - push: bump is skipped; the !cancelled() && !failure() guard lets
|
|
97
|
-
# this job run regardless. The [skip ci] check filters the
|
|
98
|
-
# bot's own bump-commit push so it does not retrigger.
|
|
99
|
-
# - dispatch: bump succeeded; the workflow_dispatch branch of the OR
|
|
100
|
-
# short-circuits the [skip ci] check (the dispatch event
|
|
101
|
-
# itself does not carry the bump's commit message).
|
|
102
|
-
# ---------------------------------------------------------------------------
|
|
103
|
-
prepare:
|
|
104
|
-
name: Prepare release
|
|
105
|
-
needs: bump
|
|
106
|
-
if: |
|
|
107
|
-
!cancelled() && !failure() &&
|
|
108
|
-
(github.event_name == 'workflow_dispatch' ||
|
|
109
|
-
(github.event_name == 'push' &&
|
|
110
|
-
!startsWith(github.event.head_commit.message, '[skip ci]')))
|
|
111
|
-
runs-on: ubuntu-latest
|
|
112
|
-
timeout-minutes: 5
|
|
113
|
-
outputs:
|
|
114
|
-
version: ${{ steps.ver.outputs.version }}
|
|
115
|
-
tag: ${{ steps.ver.outputs.tag }}
|
|
116
|
-
skip: ${{ steps.ver.outputs.skip }}
|
|
117
|
-
changelog: ${{ steps.changelog.outputs.notes }}
|
|
118
|
-
# Surface the resolved checkout-ref so downstream jobs (build, release)
|
|
119
|
-
# can use it. They cannot reference `needs.bump.outputs.*` directly
|
|
120
|
-
# because they only have `needs: prepare` (or [prepare, build]) — not
|
|
121
|
-
# `bump` — in their needs context.
|
|
122
|
-
ref: ${{ needs.bump.outputs.tag || github.sha }}
|
|
123
|
-
steps:
|
|
124
|
-
- uses: actions/checkout@v4
|
|
125
|
-
with:
|
|
126
|
-
# On dispatch, check out the freshly-pushed tag; on push, the
|
|
127
|
-
# triggering SHA already has the bumped package.json.
|
|
128
|
-
# (Prepare cannot reference its own `outputs.ref` here — that's
|
|
129
|
-
# only available to downstream jobs.)
|
|
130
|
-
ref: ${{ needs.bump.outputs.tag || github.sha }}
|
|
131
|
-
fetch-depth: 0
|
|
132
|
-
|
|
133
|
-
- name: Resolve version
|
|
134
|
-
id: ver
|
|
135
|
-
env:
|
|
136
|
-
GH_TOKEN: ${{ github.token }}
|
|
137
|
-
run: |
|
|
138
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
139
|
-
TAG="v${VERSION}"
|
|
140
|
-
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
141
|
-
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
|
142
|
-
|
|
143
|
-
if gh release view "${TAG}" > /dev/null 2>&1; then
|
|
144
|
-
echo "Release ${TAG} already exists — skipping"
|
|
145
|
-
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
146
|
-
else
|
|
147
|
-
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
148
|
-
fi
|
|
149
|
-
|
|
150
|
-
- name: Find previous release tag
|
|
151
|
-
id: prev
|
|
152
|
-
if: steps.ver.outputs.skip == 'false'
|
|
153
|
-
env:
|
|
154
|
-
GH_TOKEN: ${{ github.token }}
|
|
155
|
-
run: |
|
|
156
|
-
TAG="${{ steps.ver.outputs.tag }}"
|
|
157
|
-
PREV=$(gh release list --limit 50 --json tagName -q '.[].tagName' | grep -v "^${TAG}$" | head -1)
|
|
158
|
-
if [ -n "$PREV" ] && git merge-base --is-ancestor "$PREV" HEAD 2>/dev/null; then
|
|
159
|
-
echo "tag=${PREV}" >> "$GITHUB_OUTPUT"
|
|
160
|
-
echo "Previous tag: ${PREV}"
|
|
161
|
-
else
|
|
162
|
-
echo "tag=" >> "$GITHUB_OUTPUT"
|
|
163
|
-
echo "No previous tag reachable from HEAD"
|
|
164
|
-
fi
|
|
165
|
-
|
|
166
|
-
- name: Generate changelog
|
|
167
|
-
id: changelog
|
|
168
|
-
if: steps.ver.outputs.skip == 'false' && steps.prev.outputs.tag != ''
|
|
169
|
-
run: |
|
|
170
|
-
PREV="${{ steps.prev.outputs.tag }}"
|
|
171
|
-
NOTES=$(git log --oneline "${PREV}..HEAD" --pretty="- %s" | head -50)
|
|
172
|
-
{
|
|
173
|
-
echo "notes<<EOF"
|
|
174
|
-
echo "$NOTES"
|
|
175
|
-
echo "EOF"
|
|
176
|
-
} >> "$GITHUB_OUTPUT"
|
|
177
|
-
|
|
178
|
-
# Echo the resolved outputs so downstream skip/no-skip decisions are
|
|
179
|
-
# debuggable from the run log without re-running with step debug.
|
|
180
|
-
- name: Debug resolved outputs
|
|
181
|
-
run: |
|
|
182
|
-
echo "version=${{ steps.ver.outputs.version }}"
|
|
183
|
-
echo "tag=${{ steps.ver.outputs.tag }}"
|
|
184
|
-
echo "skip=${{ steps.ver.outputs.skip }}"
|
|
185
|
-
echo "prev=${{ steps.prev.outputs.tag }}"
|
|
186
|
-
|
|
187
|
-
# ---------------------------------------------------------------------------
|
|
188
|
-
# Build & Publish: matrix build of platform binaries + npm publish via OIDC.
|
|
189
|
-
#
|
|
190
|
-
# The reusable workflow filename is `version.yml` because npm Trusted
|
|
191
|
-
# Publisher is configured against that exact path. Renaming requires
|
|
192
|
-
# updating the npmjs.com Trusted Publisher entry first.
|
|
193
|
-
#
|
|
194
|
-
# The `if:` uses `always() && needs.prepare.result == 'success' &&
|
|
195
|
-
# needs.prepare.outputs.skip != 'true'`. This is the bulletproof pattern
|
|
196
|
-
# for reusable-workflow callers when any upstream job in the `needs:`
|
|
197
|
-
# chain was SKIPPED. With the simpler `needs.prepare.outputs.skip != 'true'`
|
|
198
|
-
# alone, GH Actions silently evaluated the gate as false even though the
|
|
199
|
-
# debug step in `prepare` proved the output was actually `'false'` — a
|
|
200
|
-
# known GH Actions quirk: when a job's transitive `needs:` chain includes
|
|
201
|
-
# a skipped job (here, `bump` is skipped on push events), the reusable-
|
|
202
|
-
# workflow caller's expression evaluator treats `needs.<job>.outputs.<x>`
|
|
203
|
-
# as null/missing regardless of the actual value.
|
|
204
|
-
#
|
|
205
|
-
# `always()` opts out of the implicit success() filter; the explicit
|
|
206
|
-
# `result == 'success'` reinstates it correctly; the outputs check then
|
|
207
|
-
# works as intended.
|
|
208
|
-
# ---------------------------------------------------------------------------
|
|
209
|
-
build:
|
|
210
|
-
name: Build & Publish
|
|
211
|
-
needs: prepare
|
|
212
|
-
if: |
|
|
213
|
-
always() &&
|
|
214
|
-
needs.prepare.result == 'success' &&
|
|
215
|
-
needs.prepare.outputs.skip != 'true'
|
|
216
|
-
uses: ./.github/workflows/version.yml
|
|
217
|
-
with:
|
|
218
|
-
version: ${{ needs.prepare.outputs.version }}
|
|
219
|
-
npm_tag: latest
|
|
220
|
-
# Use prepare.outputs.ref (which resolves to the bump-job tag on
|
|
221
|
-
# dispatch, or `github.sha` on push). Build cannot reference
|
|
222
|
-
# `needs.bump.*` directly — only `prepare` is in its `needs:` chain.
|
|
223
|
-
# On the push path nobody creates the tag before this runs; the
|
|
224
|
-
# SHA-based checkout works because the merge commit already has the
|
|
225
|
-
# bumped package.json. The release job creates the tag at the end
|
|
226
|
-
# via `gh release create`.
|
|
227
|
-
ref: ${{ needs.prepare.outputs.ref }}
|
|
228
|
-
secrets: inherit
|
|
229
|
-
|
|
230
|
-
# ---------------------------------------------------------------------------
|
|
231
|
-
# Release: download artifacts, create GitHub Release with cliff-free notes.
|
|
232
|
-
# ---------------------------------------------------------------------------
|
|
233
|
-
release:
|
|
234
|
-
name: Create GitHub Release
|
|
235
|
-
needs: [prepare, build]
|
|
236
|
-
if: |
|
|
237
|
-
always() &&
|
|
238
|
-
needs.prepare.result == 'success' &&
|
|
239
|
-
needs.build.result == 'success' &&
|
|
240
|
-
needs.prepare.outputs.skip != 'true'
|
|
241
|
-
runs-on: ubuntu-latest
|
|
242
|
-
timeout-minutes: 10
|
|
243
|
-
steps:
|
|
244
|
-
- uses: actions/checkout@v4
|
|
245
|
-
with:
|
|
246
|
-
# Same as the build job: prefer the bump job's tag (dispatch
|
|
247
|
-
# path) but fall back to the SHA (push path, no tag exists yet).
|
|
248
|
-
ref: ${{ needs.prepare.outputs.ref }}
|
|
249
|
-
|
|
250
|
-
- name: Download binaries
|
|
251
|
-
uses: actions/download-artifact@v4
|
|
252
|
-
with:
|
|
253
|
-
path: dist/
|
|
254
|
-
pattern: binaries-*
|
|
255
|
-
merge-multiple: true
|
|
256
|
-
|
|
257
|
-
- name: List artifacts
|
|
258
|
-
run: ls -la dist/
|
|
259
|
-
|
|
260
|
-
- name: Create release
|
|
261
|
-
env:
|
|
262
|
-
GH_TOKEN: ${{ github.token }}
|
|
263
|
-
RELEASE_NOTES: ${{ needs.prepare.outputs.changelog }}
|
|
264
|
-
run: |
|
|
265
|
-
TAG="${{ needs.prepare.outputs.tag }}"
|
|
266
|
-
VERSION="${{ needs.prepare.outputs.version }}"
|
|
267
|
-
|
|
268
|
-
if [ -z "$RELEASE_NOTES" ]; then
|
|
269
|
-
RELEASE_NOTES="Release ${TAG}"
|
|
270
|
-
fi
|
|
271
|
-
|
|
272
|
-
{
|
|
273
|
-
echo "$RELEASE_NOTES"
|
|
274
|
-
echo ""
|
|
275
|
-
echo "## Install"
|
|
276
|
-
echo ""
|
|
277
|
-
echo '```bash'
|
|
278
|
-
echo "npm install pgserve@${VERSION}"
|
|
279
|
-
echo "bunx pgserve@${VERSION}"
|
|
280
|
-
echo '```'
|
|
281
|
-
} > /tmp/release-notes.md
|
|
282
|
-
|
|
283
|
-
# The tag already exists (created by bump job on dispatch, or by the
|
|
284
|
-
# human commit on push). gh release create resolves --target via the
|
|
285
|
-
# tag automatically when omitted.
|
|
286
|
-
gh release create "${TAG}" \
|
|
287
|
-
--title "${TAG}" \
|
|
288
|
-
--notes-file /tmp/release-notes.md \
|
|
289
|
-
dist/*
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
name: Build All Platforms
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_call:
|
|
5
|
-
inputs:
|
|
6
|
-
version:
|
|
7
|
-
description: 'Version to publish'
|
|
8
|
-
required: true
|
|
9
|
-
type: string
|
|
10
|
-
npm_tag:
|
|
11
|
-
description: 'npm dist-tag (next or latest)'
|
|
12
|
-
required: false
|
|
13
|
-
type: string
|
|
14
|
-
default: 'next'
|
|
15
|
-
ref:
|
|
16
|
-
description: 'Git ref to checkout (tag or commit)'
|
|
17
|
-
required: false
|
|
18
|
-
type: string
|
|
19
|
-
workflow_dispatch:
|
|
20
|
-
inputs:
|
|
21
|
-
version:
|
|
22
|
-
description: 'Version (leave empty for build-only)'
|
|
23
|
-
required: false
|
|
24
|
-
type: string
|
|
25
|
-
npm_tag:
|
|
26
|
-
description: 'npm dist-tag'
|
|
27
|
-
required: false
|
|
28
|
-
type: choice
|
|
29
|
-
options:
|
|
30
|
-
- next
|
|
31
|
-
- latest
|
|
32
|
-
default: 'next'
|
|
33
|
-
|
|
34
|
-
concurrency:
|
|
35
|
-
group: build-all-platforms-${{ github.ref }}
|
|
36
|
-
cancel-in-progress: true
|
|
37
|
-
|
|
38
|
-
jobs:
|
|
39
|
-
build:
|
|
40
|
-
name: Build ${{ matrix.platform }}
|
|
41
|
-
runs-on: ${{ matrix.os }}
|
|
42
|
-
strategy:
|
|
43
|
-
fail-fast: false
|
|
44
|
-
matrix:
|
|
45
|
-
include:
|
|
46
|
-
# Linux x64
|
|
47
|
-
- platform: linux-x64
|
|
48
|
-
output: pgserve-linux-x64
|
|
49
|
-
os: ubuntu-latest
|
|
50
|
-
# macOS ARM64 (Apple Silicon)
|
|
51
|
-
- platform: darwin-arm64
|
|
52
|
-
output: pgserve-darwin-arm64
|
|
53
|
-
os: macos-latest
|
|
54
|
-
# Windows x64 - must build on Windows for --windows-icon
|
|
55
|
-
- platform: windows-x64
|
|
56
|
-
output: pgserve-windows-x64.exe
|
|
57
|
-
os: windows-latest
|
|
58
|
-
|
|
59
|
-
steps:
|
|
60
|
-
- name: Checkout
|
|
61
|
-
uses: actions/checkout@v4
|
|
62
|
-
with:
|
|
63
|
-
ref: ${{ inputs.ref || github.ref }}
|
|
64
|
-
|
|
65
|
-
- name: Setup Bun
|
|
66
|
-
uses: oven-sh/setup-bun@v2
|
|
67
|
-
with:
|
|
68
|
-
bun-version: 1.3.11
|
|
69
|
-
|
|
70
|
-
- name: Install dependencies
|
|
71
|
-
run: bun install
|
|
72
|
-
|
|
73
|
-
# Windows: native build with icon and proper metadata
|
|
74
|
-
- name: Build for Windows (with branding)
|
|
75
|
-
if: matrix.platform == 'windows-x64'
|
|
76
|
-
run: |
|
|
77
|
-
New-Item -ItemType Directory -Force -Path dist | Out-Null
|
|
78
|
-
$RAW_VERSION = node -p "require('./package.json').version"
|
|
79
|
-
# Convert 1.1.3-rc.10 to 1.1.3.10 (Windows requires X.Y.Z.W format)
|
|
80
|
-
$WIN_VERSION = $RAW_VERSION -replace '-rc\.', '.'
|
|
81
|
-
Write-Host "Raw version: $RAW_VERSION -> Windows version: $WIN_VERSION"
|
|
82
|
-
bun build --compile `
|
|
83
|
-
--define BUILD_VERSION="'$RAW_VERSION'" `
|
|
84
|
-
--windows-icon=assets/icon.ico `
|
|
85
|
-
--windows-title="pgserve" `
|
|
86
|
-
--windows-publisher="Namastex Labs" `
|
|
87
|
-
--windows-description="Embedded PostgreSQL Server - Zero config, auto-provision, unlimited connections" `
|
|
88
|
-
--windows-version="$WIN_VERSION" `
|
|
89
|
-
--windows-copyright="Copyright (c) 2025 Namastex Labs" `
|
|
90
|
-
bin/postgres-server.js --outfile dist/${{ matrix.output }}
|
|
91
|
-
Get-ChildItem dist/
|
|
92
|
-
shell: pwsh
|
|
93
|
-
|
|
94
|
-
# Linux/macOS: native build
|
|
95
|
-
- name: Build for ${{ matrix.platform }}
|
|
96
|
-
if: matrix.platform != 'windows-x64'
|
|
97
|
-
run: |
|
|
98
|
-
mkdir -p dist
|
|
99
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
100
|
-
bun build --compile --define BUILD_VERSION="'$VERSION'" bin/postgres-server.js --outfile dist/${{ matrix.output }}
|
|
101
|
-
ls -lh dist/
|
|
102
|
-
|
|
103
|
-
- name: Upload artifact
|
|
104
|
-
uses: actions/upload-artifact@v4
|
|
105
|
-
with:
|
|
106
|
-
name: binaries-${{ matrix.platform }}
|
|
107
|
-
path: dist/${{ matrix.output }}*
|
|
108
|
-
retention-days: 7
|
|
109
|
-
|
|
110
|
-
publish:
|
|
111
|
-
name: Publish to npm
|
|
112
|
-
needs: build
|
|
113
|
-
runs-on: ubuntu-latest
|
|
114
|
-
if: inputs.version != ''
|
|
115
|
-
# Note: `environment: npm-publish` was removed because the npmjs.com
|
|
116
|
-
# Trusted Publisher entry for `pgserve` does not declare an environment
|
|
117
|
-
# name. With the env gate present here, the OIDC token's environment
|
|
118
|
-
# claim did not match the registry's expectation and `npm publish`
|
|
119
|
-
# returned 404. Re-add this line if/when the Trusted Publisher entry
|
|
120
|
-
# has its Environment Name field set to `npm-publish`.
|
|
121
|
-
permissions:
|
|
122
|
-
id-token: write
|
|
123
|
-
contents: read
|
|
124
|
-
|
|
125
|
-
steps:
|
|
126
|
-
- name: Checkout
|
|
127
|
-
uses: actions/checkout@v4
|
|
128
|
-
with:
|
|
129
|
-
ref: ${{ inputs.ref || github.ref }}
|
|
130
|
-
|
|
131
|
-
# Node 24 ships npm 11.5+ which has built-in OIDC trusted-publisher
|
|
132
|
-
# support. Avoids the `npm install -g npm@latest` self-upgrade bug
|
|
133
|
-
# (Arborist clobbering its own promise-retry dep mid-install) that
|
|
134
|
-
# broke rlmx's OIDC publish on Node 22.
|
|
135
|
-
- name: Setup Node.js
|
|
136
|
-
uses: actions/setup-node@v4
|
|
137
|
-
with:
|
|
138
|
-
node-version: '24'
|
|
139
|
-
registry-url: 'https://registry.npmjs.org'
|
|
140
|
-
|
|
141
|
-
- name: Setup Bun
|
|
142
|
-
uses: oven-sh/setup-bun@v2
|
|
143
|
-
with:
|
|
144
|
-
bun-version: 1.3.11
|
|
145
|
-
|
|
146
|
-
- name: Install dependencies
|
|
147
|
-
run: bun install
|
|
148
|
-
|
|
149
|
-
- name: Verify npm version supports OIDC trusted publishing
|
|
150
|
-
run: |
|
|
151
|
-
NPM_VERSION=$(npm --version)
|
|
152
|
-
echo "npm version: ${NPM_VERSION}"
|
|
153
|
-
MAJOR=$(echo "${NPM_VERSION}" | cut -d. -f1)
|
|
154
|
-
if [ "${MAJOR}" -lt 11 ]; then
|
|
155
|
-
echo "::error::npm ${NPM_VERSION} too old — OIDC requires >= 11.5.1. Bump node-version above."
|
|
156
|
-
exit 1
|
|
157
|
-
fi
|
|
158
|
-
|
|
159
|
-
- name: Download all artifacts
|
|
160
|
-
uses: actions/download-artifact@v4
|
|
161
|
-
with:
|
|
162
|
-
path: dist/
|
|
163
|
-
pattern: binaries-*
|
|
164
|
-
merge-multiple: true
|
|
165
|
-
|
|
166
|
-
- name: Verify binaries
|
|
167
|
-
run: |
|
|
168
|
-
echo "Downloaded binaries:"
|
|
169
|
-
ls -la dist/
|
|
170
|
-
|
|
171
|
-
MISSING=""
|
|
172
|
-
# Supported platforms: linux-x64, darwin-arm64, windows-x64
|
|
173
|
-
for platform in linux-x64 darwin-arm64; do
|
|
174
|
-
if [ ! -f "dist/pgserve-$platform" ]; then
|
|
175
|
-
MISSING="$MISSING pgserve-$platform"
|
|
176
|
-
fi
|
|
177
|
-
done
|
|
178
|
-
if [ ! -f "dist/pgserve-windows-x64.exe" ]; then
|
|
179
|
-
MISSING="$MISSING pgserve-windows-x64.exe"
|
|
180
|
-
fi
|
|
181
|
-
|
|
182
|
-
if [ -n "$MISSING" ]; then
|
|
183
|
-
echo "Missing binaries:$MISSING"
|
|
184
|
-
exit 1
|
|
185
|
-
fi
|
|
186
|
-
|
|
187
|
-
echo "All binaries present!"
|
|
188
|
-
|
|
189
|
-
- name: Check if version already published
|
|
190
|
-
id: check
|
|
191
|
-
run: |
|
|
192
|
-
VERSION="${{ inputs.version }}"
|
|
193
|
-
if npm view pgserve@$VERSION version >/dev/null 2>&1; then
|
|
194
|
-
echo "Version $VERSION already published"
|
|
195
|
-
echo "published=true" >> $GITHUB_OUTPUT
|
|
196
|
-
else
|
|
197
|
-
echo "Version $VERSION not yet published"
|
|
198
|
-
echo "published=false" >> $GITHUB_OUTPUT
|
|
199
|
-
fi
|
|
200
|
-
|
|
201
|
-
- name: Publish to npm via OIDC
|
|
202
|
-
if: steps.check.outputs.published == 'false'
|
|
203
|
-
env:
|
|
204
|
-
HUSKY: "0"
|
|
205
|
-
# npm auto-enables provenance in any CI env with `id-token: write`,
|
|
206
|
-
# regardless of the --provenance CLI flag. On some runners the
|
|
207
|
-
# server-side sigstore check fails with 422; disable explicitly.
|
|
208
|
-
# OIDC token exchange still happens.
|
|
209
|
-
NPM_CONFIG_PROVENANCE: "false"
|
|
210
|
-
run: |
|
|
211
|
-
echo "Publishing version ${{ inputs.version }} with tag ${{ inputs.npm_tag }} via OIDC"
|
|
212
|
-
npm publish --access public --tag ${{ inputs.npm_tag }}
|
|
213
|
-
|
|
214
|
-
- name: Verify publish
|
|
215
|
-
if: steps.check.outputs.published == 'false'
|
|
216
|
-
run: |
|
|
217
|
-
# npm registry can take up to 30s to propagate
|
|
218
|
-
for i in 1 2 3 4 5; do
|
|
219
|
-
echo "Attempt $i: Checking npm for pgserve@${{ inputs.version }}..."
|
|
220
|
-
if npm view pgserve@${{ inputs.version }} version 2>/dev/null; then
|
|
221
|
-
echo "Successfully published pgserve@${{ inputs.version }} with tag @${{ inputs.npm_tag }}"
|
|
222
|
-
exit 0
|
|
223
|
-
fi
|
|
224
|
-
echo "Not found yet, waiting 10s..."
|
|
225
|
-
sleep 10
|
|
226
|
-
done
|
|
227
|
-
echo "Warning: Version not found after 50s, but publish command succeeded"
|
|
228
|
-
exit 0
|
package/.husky/pre-commit
DELETED