Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to NPM and MCP Registry | |
| on: | |
| push: | |
| tags: | |
| - "v*" # Triggers on version tags like v1.0.0 | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Required for GitHub release | |
| id-token: write # Required for npm provenance and OIDC authentication | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run validation pipeline | |
| run: pnpm run validate | |
| - name: Verify package contents | |
| run: | | |
| echo "Files to be published:" | |
| npm pack --dry-run | |
| - name: Publish to npm | |
| run: npm publish --provenance --access public | |
| - name: Build Claude Desktop Extension (.mcpb) | |
| run: | | |
| chmod +x ./scripts/build-mcpb.sh | |
| ./scripts/build-mcpb.sh | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| reddit-mcp-server.mcpb | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install MCP Publisher | |
| run: | | |
| curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.7.9/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher | |
| chmod +x ./mcp-publisher | |
| - name: Login to MCP Registry | |
| run: ./mcp-publisher login github-oidc | |
| - name: Publish to MCP Registry | |
| run: ./mcp-publisher publish |