Publish to Smithery #4
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: | |
| workflow_run: | |
| workflows: ["Release"] | |
| types: [completed] | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish: | |
| name: Publish multi-arch MCPB | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.workflow_run.head_branch }} | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install mcpb CLI | |
| run: npm install -g @anthropic-ai/mcpb | |
| - name: Build all platform binaries | |
| run: | | |
| VERSION="${{ github.event.workflow_run.head_branch }}" | |
| VERSION="${VERSION#v}" | |
| mkdir -p bundle/server/bin | |
| cp smithery/run.sh bundle/server/run.sh | |
| chmod +x bundle/server/run.sh | |
| build_one() { | |
| local goos="$1" goarch="$2" ext="$3" | |
| local out="bundle/server/bin/${goos}_${goarch}" | |
| mkdir -p "$out" | |
| CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" \ | |
| go build -trimpath -ldflags "-s -w -X main.serverVersion=${VERSION}" \ | |
| -o "${out}/ionoscloud-mcp${ext}" . | |
| chmod +x "${out}/ionoscloud-mcp${ext}" || true | |
| } | |
| build_one darwin amd64 "" | |
| build_one darwin arm64 "" | |
| build_one linux amd64 "" | |
| build_one linux arm64 "" | |
| build_one windows amd64 ".exe" | |
| - name: Prepare manifest | |
| run: | | |
| VERSION="${{ github.event.workflow_run.head_branch }}" | |
| VERSION="${VERSION#v}" | |
| jq --arg v "$VERSION" '.version = $v' \ | |
| smithery/manifest.json > bundle/manifest.json | |
| - name: Pack MCPB bundle | |
| run: mcpb pack ./bundle ./ionoscloud-mcp.mcpb | |
| - name: Publish to Smithery | |
| run: | | |
| npx @smithery/cli mcp publish \ | |
| ./ionoscloud-mcp.mcpb \ | |
| -n ionos-cloud/ionoscloud-mcp | |
| env: | |
| SMITHERY_API_KEY: ${{ secrets.SMITHERY_TOKEN }} |