mcp-freescout/.github/workflows/release-please.yml
Jack Arturo ce0ae11c8b
fix(release): use npm trusted publishing without token auth (#45)
Switch the Release Please publish job to the actual OIDC trusted publishing flow so npm publish no longer depends on an NPM_TOKEN secret.
2026-04-23 15:08:29 +02:00

102 lines
3 KiB
YAML

# Release Please - Automated versioning and npm publishing
#
# How it works:
# 1. Every push to main with conventional commits updates a "Release PR"
# 2. When you merge the Release PR, it:
# - Updates version in package.json
# - Updates CHANGELOG.md
# - Creates a GitHub Release with tag
# - Triggers the npm publish job below
#
# Commit message format:
# feat: add new feature → minor version bump
# fix: fix a bug → patch version bump
# feat!: breaking change → major version bump
# chore/docs: no version bump
#
# npm Publishing:
# Uses Trusted Publishing (OIDC) - no secrets needed!
# Configure at: https://www.npmjs.com/package/@verygoodplugins/mcp-{name}/access
name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: node
npm-publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm test
# Trusted Publishing via OIDC - no npm token secret required
- run: npm publish --access public --provenance
mcp-registry-publish:
needs: [release-please, npm-publish]
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install mcp-publisher CLI
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
sudo mv mcp-publisher /usr/local/bin/
- name: Publish to MCP Registry
run: |
mcp-publisher login github-oidc
mcp-publisher publish
env:
MCP_REGISTRY_URL: https://registry.modelcontextprotocol.io
announce:
needs: [release-please, npm-publish]
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
steps:
- name: Post to Slack
if: ${{ vars.SLACK_WEBHOOK_URL }}
uses: slackapi/slack-github-action@v1
with:
webhook-url: ${{ vars.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "🚀 ${{ github.repository }} ${{ needs.release-please.outputs.tag_name }} released!\n\nhttps://github.com/${{ github.repository }}/releases/tag/${{ needs.release-please.outputs.tag_name }}"
}