Merge pull request #20 from GenAIwithMS/ci/update-workflow #11
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 Smithery | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| smithery-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install All Dependencies | |
| run: npm install | |
| - name: Compile and Bundle via esbuild | |
| run: | | |
| npm run build | |
| npm run bundle | |
| # Flattens dist/index.js to the root folder of the archive | |
| - name: Stage Bundle Elements | |
| run: | | |
| mkdir staging | |
| cp dist/index.js staging/index.js | |
| cp manifest.json staging/ | |
| cp smithery.yaml staging/ | |
| cp package.json staging/ | |
| cp README.md staging/ | |
| # Zips the staging contents directly so manifest.json is at the root entry point | |
| - name: Build Valid .mcpb Zip Archive | |
| run: | | |
| cd staging | |
| zip -r ../twitter-mcp.mcpb . | |
| cd .. | |
| ls -lh twitter-mcp.mcpb | |
| - name: Install Smithery CLI | |
| run: npm install -g smithery@latest | |
| - name: Publish to Smithery Registry | |
| run: | | |
| smithery mcp publish ./twitter-mcp.mcpb -n muhammadsiddiq/twitter-mcp | |
| env: | |
| SMITHERY_API_KEY: ${{ secrets.SMITHERY_TOKEN }} |