Skip to content

Commit 3bbb6bb

Browse files
committed
Inject the release version into npm/PyPI packaging at publish time
The 0.8.0 release failed at publish-registries because pkg/npm/package.json still carried the previous hand-pinned version and npm refuses to publish over an existing release. The job now rewrites pkg/npm/package.json and pkg/pypi/pyproject.toml from the workflow's version input (with grep verification that the injection took) before publishing, so a forgotten manual bump can never fail the pipeline again. server.json needs no injection - publish-mcp-registry already syncs it from the published npm package.
1 parent 9725771 commit 3bbb6bb

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,24 @@ jobs:
273273
steps:
274274
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
275275

276+
# The packaged versions MUST match the dispatched release version —
277+
# the 0.8.0 release failed here because pkg/npm still carried the
278+
# previous release's hand-pinned version and npm refuses to publish
279+
# over an existing version. Inject the dispatch input so a forgotten
280+
# manual bump can never fail the pipeline again. (server.json needs
281+
# no injection: publish-mcp-registry syncs it from pkg/npm.)
282+
- name: Sync packaging versions to the release version
283+
env:
284+
RELEASE_VERSION: ${{ inputs.version }}
285+
run: |
286+
V="${RELEASE_VERSION#v}"
287+
jq --arg v "$V" '.version = $v' pkg/npm/package.json > pkg/npm/package.tmp
288+
mv pkg/npm/package.tmp pkg/npm/package.json
289+
sed -i "s/^version = \".*\"/version = \"$V\"/" pkg/pypi/pyproject.toml
290+
grep -q "\"version\": \"$V\"" pkg/npm/package.json
291+
grep -q "^version = \"$V\"" pkg/pypi/pyproject.toml
292+
echo "packaging synced to $V"
293+
276294
# ── npm ──────────────────────────────────────────────────
277295
- name: Setup Node
278296
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0

0 commit comments

Comments
 (0)