Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .github/workflows/publish-mcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,35 @@ jobs:

tar -xzf "$archive" mcp-publisher

- name: Filter unpublished PyPI registry entries (if PyPI release not yet published)
run: |
set -euo pipefail
cp server.json server.json.bak
node -e '
const fs = require("node:fs");
const manifest = JSON.parse(fs.readFileSync("server.json", "utf8"));
(async () => {
const kept = [];
for (const pkg of manifest.packages || []) {
if (pkg.registryType === "pypi") {
const res = await fetch(`https://pypi.org/pypi/${pkg.identifier}/${pkg.version}/json`);
if (!res.ok) {
console.log(`::warning::PyPI package ${pkg.identifier}@${pkg.version} not found (${res.status}) — omitting from this MCP Registry publish.`);
continue;
}
}
kept.push(pkg);
}
manifest.packages = kept;
fs.writeFileSync("server.json", `${JSON.stringify(manifest, null, 2)}\n`, "utf8");
})().catch((err) => { console.error(err); process.exit(1); });
'

- name: Authenticate with MCP Registry (GitHub OIDC)
run: ./mcp-publisher login github-oidc

- name: Publish server.json to MCP Registry
run: ./mcp-publisher publish
run: |
set -euo pipefail
trap 'if [ -f server.json.bak ]; then mv server.json.bak server.json; fi' EXIT
./mcp-publisher publish
12 changes: 11 additions & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,14 @@ jobs:
- name: Publish package to npm with SLSA provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --provenance --access public
run: |
PKG_VER=$(node -e "console.log(JSON.parse(require('fs').readFileSync('package.json','utf8')).version)")
if npm view "@ritualdev-lab/mcpshelf@${PKG_VER}" version >/dev/null 2>&1; then
echo "Skipping @ritualdev-lab/mcpshelf@${PKG_VER} (already published on npm)"
exit 0
fi
if [ -z "${NODE_AUTH_TOKEN:-}" ]; then
echo "::warning::secrets.NPM_TOKEN is not configured — skipping npmjs.org publish."
exit 0
fi
npm publish --provenance --access public
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
publish-pypi:
name: Publish mcpshelf to PyPI
needs: [build-and-test]
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/python-v') || startsWith(github.ref, 'refs/tags/v')
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/python-v')
runs-on: ubuntu-latest
permissions:
id-token: write
Expand Down