8080 git push origin main
8181 fi
8282
83+ - name : Get registry version
84+ if : inputs.image_name == 'awesome-copilot'
85+ id : registry
86+ shell : pwsh
87+ run : |
88+ pushd awesome-copilot
89+
90+ $server = Get-Content ./server.json | ConvertFrom-Json
91+ $version = $($server.version).Split(".")
92+ $release = Get-Date -Format "yyyyMMddHH" -AsUTC
93+
94+ $revised = "$([string]::Join(".", $version[0..1])).$release"
95+
96+ $server.version = $revised
97+ $server.packages[0].version = $revised
98+ $server | ConvertTo-Json -Depth 10 | Out-File -FilePath ./server.json -Encoding utf8 -Force
99+
100+ echo "version=$revised" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
101+
102+ popd
103+
83104 - name : Build app
84105 if : env.BUILD_IMAGE == 'true' || inputs.force == true
85106 shell : bash
@@ -124,10 +145,26 @@ jobs:
124145 steps.check-dockerfile.outputs.exists == 'true'
125146 uses : docker/setup-buildx-action@v3
126147
127- - name : Build and push Docker image - multi-platform
148+ - name : Build and push Docker image - multi-platform for awesome-copilot
128149 if : |
129150 (env.BUILD_IMAGE == 'true' || inputs.force == true) &&
130- steps.check-dockerfile.outputs.exists == 'true'
151+ steps.check-dockerfile.outputs.exists == 'true' &&
152+ inputs.image_name == 'awesome-copilot'
153+ id : push-multiplatform
154+ uses : docker/build-push-action@v6
155+ with :
156+ platforms : linux/amd64,linux/arm64
157+ push : true
158+ context : ${{ github.workspace }}
159+ file : ${{ github.workspace }}/Dockerfile.${{ inputs.image_name }}
160+ tags : ' ${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}:latest,${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}:${{ steps.registry.outputs.version }}'
161+ labels : ${{ steps.meta.outputs.labels }}
162+
163+ - name : Build and push Docker image - multi-platform for other images
164+ if : |
165+ (env.BUILD_IMAGE == 'true' || inputs.force == true) &&
166+ steps.check-dockerfile.outputs.exists == 'true' &&
167+ inputs.image_name != 'awesome-copilot'
131168 id : push-multiplatform
132169 uses : docker/build-push-action@v6
133170 with :
@@ -147,3 +184,21 @@ jobs:
147184 subject-name : ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}
148185 subject-digest : ${{ steps.push-multiplatform.outputs.digest }}
149186 push-to-registry : true
187+
188+ - name : Install mcp-publisher
189+ if : inputs.image_name == 'awesome-copilot'
190+ shell : bash
191+ run : |
192+ curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
193+
194+ - name : Authenticate to MCP Registry
195+ if : inputs.image_name == 'awesome-copilot'
196+ shell : bash
197+ run : |
198+ ./mcp-publisher login github-oidc
199+
200+ - name : Publish server to MCP Registry
201+ if : inputs.image_name == 'awesome-copilot'
202+ shell : bash
203+ run : |
204+ ./mcp-publisher publish
0 commit comments