|
| 1 | +# SPDX-FileCopyrightText: 2026 The RISE Project |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | +--- |
| 4 | +# This workflow is based on the `build-admin-ui` and `build-binaries` jobs of |
| 5 | +# https://github.com/dcc-mcp/dcc-mcp-core/blob/main/.github/workflows/release.yml |
| 6 | +name: Build dcc-mcp-server wheels (riscv64) |
| 7 | + |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + version: |
| 12 | + description: 'Version glob to (re)build; empty builds every version of docs/packages/dcc-mcp-server.yaml not released yet' |
| 13 | + required: false |
| 14 | + default: '' |
| 15 | + pull_request: |
| 16 | + branches: [main] |
| 17 | + paths: |
| 18 | + - '.github/workflows/build-dcc-mcp-server.yml' |
| 19 | + - 'docs/packages/dcc-mcp-server.yaml' |
| 20 | + push: |
| 21 | + branches: [main] |
| 22 | + paths: |
| 23 | + - '.github/workflows/build-dcc-mcp-server.yml' |
| 24 | + - 'docs/packages/dcc-mcp-server.yaml' |
| 25 | + |
| 26 | +concurrency: |
| 27 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 28 | + cancel-in-progress: true |
| 29 | + |
| 30 | +permissions: |
| 31 | + contents: read # to fetch code (actions/checkout) |
| 32 | + |
| 33 | +jobs: |
| 34 | + setup: |
| 35 | + uses: $/.github/workflows/_setup.yml |
| 36 | + with: |
| 37 | + package: dcc-mcp-server |
| 38 | + version: ${{ inputs.version }} |
| 39 | + |
| 40 | + build_admin_ui: |
| 41 | + needs: [setup] |
| 42 | + if: needs.setup.outputs.versions != '[]' |
| 43 | + strategy: |
| 44 | + fail-fast: false |
| 45 | + matrix: |
| 46 | + version: ${{ fromJSON(needs.setup.outputs.versions) }} |
| 47 | + name: Build dcc-mcp-server ${{ matrix.version }} admin UI |
| 48 | + runs-on: ubuntu-latest |
| 49 | + timeout-minutes: 30 |
| 50 | + |
| 51 | + env: |
| 52 | + DCC_MCP_SERVER_VERSION: ${{ matrix.version }} |
| 53 | + |
| 54 | + steps: |
| 55 | + - name: Checkout dcc-mcp-core v${{ env.DCC_MCP_SERVER_VERSION }} |
| 56 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 57 | + with: |
| 58 | + repository: dcc-mcp/dcc-mcp-core |
| 59 | + ref: v${{ env.DCC_MCP_SERVER_VERSION }} |
| 60 | + persist-credentials: false |
| 61 | + |
| 62 | + # Upstream provisions Node through vx (vx.toml pins node 22) and runs |
| 63 | + # scripts/release/prebuild_admin_ui.sh; these are that script's npm calls. |
| 64 | + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 |
| 65 | + with: |
| 66 | + node-version: '22' |
| 67 | + |
| 68 | + - name: Build admin UI bundle |
| 69 | + run: | |
| 70 | + npm --prefix admin-ui ci --ignore-scripts --include=optional |
| 71 | + npm --prefix admin-ui install lightningcss-linux-x64-gnu --no-save --ignore-scripts |
| 72 | + npm --prefix admin-ui run build |
| 73 | + test -f crates/dcc-mcp-gateway-admin/src/generated/index.html |
| 74 | +
|
| 75 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 76 | + with: |
| 77 | + name: dcc-mcp-server-${{ env.DCC_MCP_SERVER_VERSION }}-admin-ui-bundle |
| 78 | + path: crates/dcc-mcp-gateway-admin/src/generated/index.html |
| 79 | + if-no-files-found: error |
| 80 | + |
| 81 | + build_wheel: |
| 82 | + needs: [setup, build_admin_ui] |
| 83 | + if: needs.setup.outputs.versions != '[]' |
| 84 | + strategy: |
| 85 | + fail-fast: false |
| 86 | + matrix: |
| 87 | + version: ${{ fromJSON(needs.setup.outputs.versions) }} |
| 88 | + name: Build dcc-mcp-server ${{ matrix.version }} py3-none-manylinux_riscv64 |
| 89 | + runs-on: ubuntu-24.04-riscv |
| 90 | + timeout-minutes: 360 |
| 91 | + |
| 92 | + env: |
| 93 | + DCC_MCP_SERVER_VERSION: ${{ matrix.version }} |
| 94 | + |
| 95 | + steps: |
| 96 | + - name: Checkout dcc-mcp-core v${{ env.DCC_MCP_SERVER_VERSION }} |
| 97 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 98 | + with: |
| 99 | + repository: dcc-mcp/dcc-mcp-core |
| 100 | + ref: v${{ env.DCC_MCP_SERVER_VERSION }} |
| 101 | + persist-credentials: false |
| 102 | + |
| 103 | + - name: Download admin UI bundle |
| 104 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 105 | + with: |
| 106 | + name: dcc-mcp-server-${{ env.DCC_MCP_SERVER_VERSION }}-admin-ui-bundle |
| 107 | + path: crates/dcc-mcp-gateway-admin/src/generated |
| 108 | + |
| 109 | + # Upstream builds this wheel in manylinux2014 (Maya 2022's glibc); the |
| 110 | + # oldest riscv64 manylinux image is 2_39, so the tag check of |
| 111 | + # scripts/release/server_wheel_tags.py does not apply here. |
| 112 | + - name: Build wheel |
| 113 | + uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 |
| 114 | + with: |
| 115 | + command: build |
| 116 | + target: riscv64gc-unknown-linux-gnu |
| 117 | + args: --release --out wheels |
| 118 | + manylinux: '2_39' |
| 119 | + working-directory: pkg/dcc-mcp-server-bin |
| 120 | + docker-options: -e DCC_MCP_ADMIN_UI_PREBUILT=1 |
| 121 | + before-script-linux: git config --global --add safe.directory "*" |
| 122 | + |
| 123 | + - name: Check the wheel carries the binary and no extension module |
| 124 | + run: | |
| 125 | + python3 - pkg/dcc-mcp-server-bin/wheels/*.whl <<'EOF' |
| 126 | + import sys, zipfile |
| 127 | + for whl in sys.argv[1:]: |
| 128 | + assert "-py3-none-manylinux" in whl, whl |
| 129 | + names = zipfile.ZipFile(whl).namelist() |
| 130 | + assert any(n.endswith(".data/scripts/dcc-mcp-server") for n in names), names |
| 131 | + assert "dcc_mcp_server/__init__.py" in names, names |
| 132 | + assert not any(n.endswith(".so") for n in names), names |
| 133 | + print(whl, "ok") |
| 134 | + EOF |
| 135 | +
|
| 136 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 137 | + with: |
| 138 | + name: dcc-mcp-server-${{ env.DCC_MCP_SERVER_VERSION }}-py3-none-manylinux_riscv64 |
| 139 | + path: pkg/dcc-mcp-server-bin/wheels/*.whl |
| 140 | + if-no-files-found: error |
| 141 | + |
| 142 | + test_wheel: |
| 143 | + name: Test dcc-mcp-server ${{ matrix.version }} on Python ${{ matrix.python-version }} |
| 144 | + needs: [setup, build_wheel] |
| 145 | + if: needs.setup.outputs.versions != '[]' |
| 146 | + runs-on: ubuntu-24.04-riscv |
| 147 | + timeout-minutes: 30 |
| 148 | + env: |
| 149 | + DCC_MCP_SERVER_VERSION: ${{ matrix.version }} |
| 150 | + UV_PYTHON_PREFERENCE: only-managed |
| 151 | + strategy: |
| 152 | + fail-fast: false |
| 153 | + matrix: |
| 154 | + version: ${{ fromJSON(needs.setup.outputs.versions) }} |
| 155 | + python-version: ['3.12', '3.13', '3.14', '3.14t'] |
| 156 | + |
| 157 | + steps: |
| 158 | + - name: Checkout dcc-mcp-core v${{ env.DCC_MCP_SERVER_VERSION }} catalog |
| 159 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 160 | + with: |
| 161 | + repository: dcc-mcp/dcc-mcp-core |
| 162 | + ref: v${{ env.DCC_MCP_SERVER_VERSION }} |
| 163 | + path: upstream |
| 164 | + sparse-checkout: dcc-mcp-catalog.yml |
| 165 | + sparse-checkout-cone-mode: false |
| 166 | + persist-credentials: false |
| 167 | + |
| 168 | + - name: Download wheel |
| 169 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 170 | + with: |
| 171 | + name: dcc-mcp-server-${{ env.DCC_MCP_SERVER_VERSION }}-py3-none-manylinux_riscv64 |
| 172 | + path: wheels |
| 173 | + |
| 174 | + - name: Download admin UI bundle |
| 175 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 176 | + with: |
| 177 | + name: dcc-mcp-server-${{ env.DCC_MCP_SERVER_VERSION }}-admin-ui-bundle |
| 178 | + path: admin-ui |
| 179 | + |
| 180 | + - name: Install Python |
| 181 | + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 |
| 182 | + with: |
| 183 | + python-version: ${{ matrix.python-version }} |
| 184 | + activate-environment: true |
| 185 | + enable-cache: false |
| 186 | + |
| 187 | + - name: Install wheel |
| 188 | + run: uv pip install --reinstall --no-index --find-links wheels dcc-mcp-server |
| 189 | + |
| 190 | + # Upstream ships no wheel-level test suite (its tests/ load the locator from |
| 191 | + # the source tree and test the binary through cargo), so drive the |
| 192 | + # installed binary: locator, catalog search, then the gateway daemon's |
| 193 | + # health, embedded admin UI and MCP initialize/tools/list. |
| 194 | + - name: Test wheel |
| 195 | + run: | |
| 196 | + set -euo pipefail |
| 197 | + python -c "import dcc_mcp_server, os, sys; p = dcc_mcp_server.binary_path(); assert str(p).startswith(sys.prefix), p; assert os.access(p, os.X_OK), p; assert dcc_mcp_server.__version__ == os.environ['DCC_MCP_SERVER_VERSION']; print(p)" |
| 198 | + dcc-mcp-server --version | grep -F "$DCC_MCP_SERVER_VERSION" |
| 199 | + dcc-mcp-server --help >/dev/null |
| 200 | +
|
| 201 | + DCC_MCP_CATALOG_PATH=upstream/dcc-mcp-catalog.yml dcc-mcp-server catalog search --query maya > catalog.json |
| 202 | + python -c "import json; hits = json.load(open('catalog.json')); assert any(h['name'] == 'dcc-mcp-maya' for h in hits), hits" |
| 203 | +
|
| 204 | + export HOME="$RUNNER_TEMP/home" |
| 205 | + mkdir -p "$HOME" |
| 206 | + port=19765 |
| 207 | + dcc-mcp-server gateway --port "$port" --remote-port 0 --registry-dir "$RUNNER_TEMP/registry" > gateway.log 2>&1 & |
| 208 | + gw=$! |
| 209 | + trap 'kill "$gw" 2>/dev/null || true; cat gateway.log' EXIT |
| 210 | + for _ in $(seq 1 60); do |
| 211 | + curl -sf "http://127.0.0.1:$port/health" >/dev/null && break |
| 212 | + sleep 1 |
| 213 | + done |
| 214 | + curl -sf "http://127.0.0.1:$port/health" | grep -F '"ok":true' |
| 215 | + curl -sf "http://127.0.0.1:$port/admin" -o admin.html |
| 216 | + cmp admin.html admin-ui/index.html |
| 217 | +
|
| 218 | + mcp() { |
| 219 | + curl -sf -X POST "http://127.0.0.1:$port/mcp" \ |
| 220 | + -H 'content-type: application/json' \ |
| 221 | + -H 'accept: application/json, text/event-stream' \ |
| 222 | + -d "$1" |
| 223 | + } |
| 224 | + mcp '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"riscv64-ci","version":"0"}}}' > init.json |
| 225 | + mcp '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' > tools.json |
| 226 | + python - <<'EOF' |
| 227 | + import json, os |
| 228 | + init = json.load(open("init.json"))["result"] |
| 229 | + assert init["serverInfo"]["version"] == os.environ["DCC_MCP_SERVER_VERSION"], init["serverInfo"] |
| 230 | + tools = {t["name"] for t in json.load(open("tools.json"))["result"]["tools"]} |
| 231 | + assert {"search", "describe", "load_skill", "call"} <= tools, tools |
| 232 | + print(init["serverInfo"], sorted(tools)) |
| 233 | + EOF |
| 234 | +
|
| 235 | + kill "$gw" |
| 236 | + wait "$gw" || true |
| 237 | + trap - EXIT |
| 238 | +
|
| 239 | + publish: |
| 240 | + name: Publish dcc-mcp-server ${{ matrix.version }} |
| 241 | + needs: [setup, build_wheel, test_wheel] |
| 242 | + if: needs.setup.outputs.versions != '[]' |
| 243 | + strategy: |
| 244 | + fail-fast: false |
| 245 | + matrix: |
| 246 | + version: ${{ fromJSON(needs.setup.outputs.versions) }} |
| 247 | + permissions: |
| 248 | + contents: write |
| 249 | + pull-requests: write |
| 250 | + uses: $/.github/workflows/_publish-wheel.yml |
| 251 | + secrets: |
| 252 | + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} |
| 253 | + with: |
| 254 | + artifact-pattern: dcc-mcp-server-${{ matrix.version }}-py3-none-manylinux_riscv64 |
0 commit comments