fleet-memory/.github/workflows/publish.yml
RCLL 707f163608 ci(publish): build on Node 22 — npm@latest (12.x) refuses to install on Node 20
npm 12 declares engines ^22.22.2 || ^24.15.0 || >=26.0.0. The workflow pinned
node-version 20 and then ran 'npm install -g npm@latest', so the engine check
would fail and the publish step would never run — with the GitHub Release
already public and the tag burnt. Caught before the first tag exists.

Package engines (node >=18) unchanged; this pins the build runner only.
2026-08-28 09:39:24 +03:00

49 lines
1.7 KiB
YAML

name: Publish to npm
# Publishes fleet-memory-mcp to npm via OIDC Trusted Publishing.
# No NPM_TOKEN needed — npm verifies this workflow's identity through the
# Trusted Publisher trust configured on npmjs.com (holetron-lab/fleet-memory).
# NOTE: that trust entry is per package AND per repo. It has to be re-created on
# npmjs.com for fleet-memory-mcp + holetron-lab/fleet-memory before the first release fires,
# otherwise the publish step fails with an OIDC mismatch.
# Fires when a GitHub Release is published; the release tag is the source of truth
# for the version already set in mcp-server/package.json.
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
id-token: write # required for OIDC provenance + Trusted Publishing
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: mcp-server
steps:
- uses: actions/checkout@v7
# Node 22, not 20: the upgrade step below pulls npm@latest, and npm 12
# declares engines node ^22.22.2 || ^24.15.0 || >=26. On Node 20 that
# install fails the engine check and the publish step never runs — after
# the GitHub Release is already public. The published package itself
# still supports Node >=18 (mcp-server/package.json engines); this pins
# only the build runner.
- uses: actions/setup-node@v7
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
# Trusted Publishing + provenance require npm >= 11.5.1
- name: Upgrade npm
run: npm install -g npm@latest
- name: Install dependencies
run: npm ci || npm install
- name: Publish
run: npm publish --provenance --access public