@@ -63,12 +63,16 @@ jobs:
6363 with :
6464 password : ${{ secrets.PYPI_API_TOKEN }}
6565
66- docker_build_push :
67- name : Build & push multi -arch image
66+ docker_build_by_platform :
67+ name : Build image per -arch and push by digest (${{ matrix.platform }})
6868 runs-on : ubuntu-latest
6969 permissions :
7070 contents : read
7171 packages : write
72+ strategy :
73+ fail-fast : false
74+ matrix :
75+ platform : [linux/amd64, linux/arm64]
7276 steps :
7377 - uses : actions/checkout@v5
7478 - name : Extract version from tag
8185 registry : ${{ env.REGISTRY }}
8286 username : ${{ github.actor }}
8387 password : ${{ secrets.GITHUB_TOKEN }}
88+ - name : Set up QEMU
89+ uses : docker/setup-qemu-action@v3
90+ - name : Set up Docker Buildx
91+ uses : docker/setup-buildx-action@v3
8492 - id : meta
8593 uses : docker/metadata-action@v5
8694 with :
@@ -91,18 +99,77 @@ jobs:
9199 type=semver,pattern={{major}}.{{minor}}
92100 type=semver,pattern={{major}}
93101 type=raw,value=latest,enable={{is_default_branch}}
94- - uses : docker/setup-buildx-action@v3
95- - uses : docker/build-push-action@v6
102+ - name : Build and push by digest (${{ matrix.platform }})
103+ id : build
104+ uses : docker/build-push-action@v6
96105 with :
97106 context : .
98- platforms : linux/amd64,linux/arm64
99- push : true
100- tags : ${{ steps.meta.outputs.tags }}
101- labels : ${{ steps.meta.outputs.labels }}
107+ platforms : ${{ matrix.platform }}
102108 build-args : |
103109 VERSION=${{ steps.ver.outputs.VERSION }}
104- cache-from : type=gha
105- cache-to : type=gha,mode=max
110+ labels : ${{ steps.meta.outputs.labels }}
111+ outputs : type=image,push-by-digest=true,name-canonical=true,push=true
112+ cache-from : |
113+ type=gha
114+ type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
115+ type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ github.ref_name }}
116+ cache-to : |
117+ type=gha,mode=max
118+ type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
119+ type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ github.ref_name }},mode=max
120+ provenance : false
121+ sbom : false
122+ - name : Export digest
123+ run : |
124+ mkdir -p "${{ runner.temp }}/digests"
125+ digest="${{ steps.build.outputs.digest }}"
126+ touch "${{ runner.temp }}/digests/${digest#sha256:}"
127+ - name : Upload digest
128+ uses : actions/upload-artifact@v4
129+ with :
130+ name : digests-${{ matrix.platform }}
131+ path : ${{ runner.temp }}/digests/*
132+ if-no-files-found : error
133+ retention-days : 1
134+
135+ docker_merge_manifest :
136+ name : Create and push multi-arch manifest
137+ runs-on : ubuntu-latest
138+ needs : docker_build_by_platform
139+ permissions :
140+ contents : read
141+ packages : write
142+ steps :
143+ - uses : docker/login-action@v3
144+ with :
145+ registry : ${{ env.REGISTRY }}
146+ username : ${{ github.actor }}
147+ password : ${{ secrets.GITHUB_TOKEN }}
148+ - uses : docker/setup-buildx-action@v3
149+ - id : meta
150+ uses : docker/metadata-action@v5
151+ with :
152+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
153+ tags : |
154+ type=ref,event=tag
155+ type=semver,pattern={{version}}
156+ type=semver,pattern={{major}}.{{minor}}
157+ type=semver,pattern={{major}}
158+ type=raw,value=latest,enable={{is_default_branch}}
159+ - name : Download digests
160+ uses : actions/download-artifact@v4
161+ with :
162+ path : ${{ runner.temp }}/digests
163+ pattern : digests-*
164+ merge-multiple : true
165+ - name : Create manifest list and push
166+ working-directory : ${{ runner.temp }}/digests
167+ run : |
168+ docker buildx imagetools create \
169+ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "${DOCKER_METADATA_OUTPUT_JSON}") \
170+ $(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
171+ - name : Inspect image
172+ run : docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
106173
107174 create_release :
108175 name : Create GitHub Release with artifacts
@@ -128,8 +195,8 @@ jobs:
128195 path : dist
129196 - uses : softprops/action-gh-release@v2
130197 with :
131- tag_name : ${GITHUB_REF#refs/tags/ }
132- name : Release ${GITHUB_REF#refs/tags/ }
198+ tag_name : ${{ github.ref_name } }
199+ name : Release ${{ github.ref_name } }
133200 body : ${{ steps.changelog.outputs.CHANGELOG }}
134201 draft : false
135202 prerelease : false
@@ -139,6 +206,7 @@ jobs:
139206
140207 publish_mcp_registry :
141208 name : Publish to MCP Registry (preview)
209+ needs : [publish_pypi, docker_merge_manifest]
142210 runs-on : ubuntu-latest
143211 permissions :
144212 contents : read
@@ -162,7 +230,7 @@ jobs:
162230 VERSION = os.environ['VERSION']
163231 with open('pyproject.toml','rb') as f:
164232 proj = tomllib.load(f)['project']
165- desc = proj.get('description','')
233+ desc = ( proj.get('description','') or '')[:100] # MCP Registry requires <= 100 chars
166234 data = {
167235 "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
168236 "name": "io.github.othervibes/mcp-as-a-judge",
0 commit comments