feat: ship wax mcp reliability and coordination updates (#57) #20
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: Release waxmcp npm package | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Version bump (patch/minor/major) or semver (for manual release) | |
| required: false | |
| default: patch | |
| push: | |
| tags: | |
| - "waxmcp-v*" | |
| jobs: | |
| build: | |
| name: Build wax + wax-mcp (${{ matrix.platform }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runs-on: macos-14 | |
| platform: darwin-x64 | |
| triple: x86_64-apple-macosx14.0 | |
| source_build: true | |
| - runs-on: macos-14 | |
| platform: darwin-arm64 | |
| triple: arm64-apple-macosx14.0 | |
| source_build: true | |
| runs-on: ${{ matrix.runs-on }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: swift-actions/setup-swift@v2 | |
| with: | |
| swift-version: "6.2" | |
| - name: Build binaries | |
| if: ${{ matrix.source_build }} | |
| run: | | |
| set -euo pipefail | |
| ./Resources/scripts/build-waxmcp-binaries.sh "${{ matrix.platform }}" "${{ matrix.triple }}" | |
| - name: Reuse checked-in binaries | |
| if: ${{ !matrix.source_build }} | |
| run: | | |
| set -euo pipefail | |
| ./Resources/scripts/build-waxmcp-binaries.sh "${{ matrix.platform }}" | |
| - name: Verify packaged binaries | |
| run: | | |
| set -euo pipefail | |
| PLATFORM_DIR="Resources/npm/waxmcp/dist/${{ matrix.platform }}" | |
| test -f "$PLATFORM_DIR/wax-cli" | |
| test -f "$PLATFORM_DIR/wax-cli.sha256" | |
| if command -v shasum >/dev/null 2>&1; then | |
| shasum -a 256 -c "$PLATFORM_DIR/wax-cli.sha256" | |
| else | |
| sha256sum -c "$PLATFORM_DIR/wax-cli.sha256" | |
| fi | |
| # Verify wax-mcp binary exists (for source builds) | |
| if [[ "${{ matrix.source_build }}" == "true" ]]; then | |
| test -f "$PLATFORM_DIR/wax-mcp" | |
| test -f "$PLATFORM_DIR/wax-mcp.sha256" | |
| fi | |
| test -d "$PLATFORM_DIR/Wax_WaxVectorSearchMiniLM.bundle" | |
| echo "MiniLM bundle present" | |
| - name: Smoke check MCP server | |
| if: ${{ matrix.source-build }} | |
| run: | | |
| set -euo pipefail | |
| Resources/npm/waxmcp/dist/${{ matrix.platform }}/wax-mcp --help | |
| - name: Smoke check CLI entrypoint | |
| if: ${{ matrix.source-build }} | |
| run: | | |
| set -euo pipefail | |
| Resources/npm/waxmcp/dist/${{ matrix.platform }}/wax-cli mcp serve --help | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: waxmcp-${{ matrix.platform }} | |
| path: Resources/npm/waxmcp/dist/${{ matrix.platform }} | |
| if-no-files-found: error | |
| publish: | |
| name: Publish waxmcp to npm | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref_name, 'waxmcp-v') }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Restore darwin-x64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: waxmcp-darwin-x64 | |
| path: Resources/npm/waxmcp/dist/darwin-x64 | |
| - name: Restore darwin-arm64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: waxmcp-darwin-arm64 | |
| path: Resources/npm/waxmcp/dist/darwin-arm64 | |
| - name: Set package version | |
| working-directory: Resources/npm/waxmcp | |
| run: | | |
| set -euo pipefail | |
| if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then | |
| npm version "${VERSION}" --no-git-tag-version --allow-same-version | |
| else | |
| VERSION="${GITHUB_REF_NAME#waxmcp-v}" | |
| npm version "${VERSION}" --no-git-tag-version --allow-same-version | |
| fi | |
| env: | |
| VERSION: ${{ inputs.version }} | |
| - name: Verify packaged binaries | |
| run: | | |
| set -euo pipefail | |
| chmod +x Resources/npm/waxmcp/dist/darwin-arm64/wax-cli | |
| test -x Resources/npm/waxmcp/dist/darwin-arm64/wax-cli | |
| chmod +x Resources/npm/waxmcp/dist/darwin-x64/wax-cli | |
| test -x Resources/npm/waxmcp/dist/darwin-x64/wax-cli | |
| # Make wax-mcp executable if present | |
| for arch in darwin-arm64 darwin-x64; do | |
| if [[ -f "Resources/npm/waxmcp/dist/$arch/wax-mcp" ]]; then | |
| chmod +x "Resources/npm/waxmcp/dist/$arch/wax-mcp" | |
| test -x "Resources/npm/waxmcp/dist/$arch/wax-mcp" | |
| fi | |
| done | |
| - name: Verify package integrity | |
| run: | | |
| set -euo pipefail | |
| for arch in darwin-arm64 darwin-x64; do | |
| for bin in wax-cli wax-mcp; do | |
| chk="Resources/npm/waxmcp/dist/$arch/$bin.sha256" | |
| if [[ -f "$chk" ]]; then | |
| if command -v shasum >/dev/null 2>&1; then | |
| shasum -a 256 -c "$chk" | |
| else | |
| sha256sum -c "$chk" | |
| fi | |
| fi | |
| done | |
| done | |
| - name: Verify version consistency | |
| run: | | |
| set -euo pipefail | |
| NPM_VERSION=$(node -p "require('./Resources/npm/waxmcp/package.json').version") | |
| echo "npm package version: $NPM_VERSION" | |
| # Extract the hardcoded version from main.swift and compare | |
| SWIFT_VERSION=$(grep -E 'let serverVersion = "[0-9]+\.[0-9]+\.[0-9]+"' Sources/WaxMCPServer/main.swift | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') | |
| echo "Swift server version: $SWIFT_VERSION" | |
| if [ "$NPM_VERSION" != "$SWIFT_VERSION" ]; then | |
| echo "ERROR: version mismatch — npm=$NPM_VERSION swift=$SWIFT_VERSION" | |
| echo "Update 'serverVersion' in Sources/WaxMCPServer/main.swift to match Resources/npm/waxmcp/package.json" | |
| exit 1 | |
| fi | |
| echo "Version consistency check passed: $NPM_VERSION" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Authenticate to npm | |
| run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > "${HOME}/.npmrc" | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish package | |
| working-directory: Resources/npm/waxmcp | |
| run: npm publish --access public |