11name : Build
22on :
3- push :
4- branches :
5- - main
6- tags :
7- - " *"
8-
9- pull_request :
10- branches :
11- - main
12-
13- workflow_dispatch :
3+ workflow_call :
144
155env :
166 DOCKER_IMAGE : ghcr.io/${{ github.repository }}
@@ -27,53 +17,17 @@ jobs:
2717 steps :
2818 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2919
30- - name : Docker meta
31- id : meta
32- uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
33- with :
34- # list of Docker images to use as base name for tags
35- images : |
36- ${{ env.DOCKER_IMAGE }}
37- # generate Docker tags based on the following events/attributes
38- tags : |
39- type=schedule
40- type=ref,event=branch
41- type=ref,event=pr
42- type=semver,pattern={{version}}
43- type=semver,pattern={{major}}.{{minor}}
44- type=semver,pattern={{major}}
45- type=raw,value=latest,enable={{is_default_branch}}
46-
47- - name : Login to Docker Registry
48- if : github.event_name != 'pull_request'
49- uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
20+ - uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5021 with :
51- registry : ghcr.io
52- username : ${{ github.repository_owner }}
53- password : ${{ secrets.GITHUB_TOKEN }}
54-
55- - name : Set up QEMU
56- uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
22+ go-version : " 1.23"
5723
58- - name : Set up Docker Buildx
59- uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
24+ - run : go mod download
25+ - run : go build -o mcp-ui-backend cmd/server/main.go
26+ env :
27+ CGO_ENABLED : 0
6028
61- - name : Build and push
62- uses : docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
29+ - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6330 with :
64- context : .
65- platforms : linux/amd64,linux/arm64
66- push : ${{ github.event_name != 'pull_request' }}
67- tags : ${{ steps.meta.outputs.tags }}
68- labels : ${{ steps.meta.outputs.labels }}
69- cache-from : type=gha
70- cache-to : type=gha,mode=max
71-
72- # Only for public repositories
73- # - name: Attest
74- # uses: actions/attest-build-provenance@v1
75- # id: attest
76- # with:
77- # subject-name: ghcr.io/${{ github.repository }}
78- # subject-digest: ${{ steps.push.outputs.digest }}
79- # push-to-registry: true
31+ name : mcp-ui-backend-binary
32+ path : mcp-ui-backend
33+ if-no-files-found : error
0 commit comments