Repository navigation
297 lines (290 loc) · 10.6 KB
/
Copy pathrelease.yml
File metadata and controls
297 lines (290 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
name: Release
on:
release:
types:
- published
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
# ── K8E server binary: linux/amd64 ───────────────────────────────────
build-k8e:
name: Build k8e
runs-on: ubuntu-latest
env:
GOOS: linux
GOARCH: amd64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
cache-dependency-path: go.sum
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config build-essential libc6-dev zlib1g-dev libseccomp-dev
- name: Generate resources
run: |
mkdir -p build/data build/static
make deps
zig build download
make generate
- name: Build k8e
run: make k8e
- name: Package CLI (data tarball)
run: make package-cli
- name: Package airgap image
run: make package-airgap
- name: Rename artifacts
run: |
mkdir -p release-artifacts
cp dist/artifacts/k8e release-artifacts/k8e
if [ -f dist/artifacts/k8e-airgap-images.tar.gz ]; then
cp dist/artifacts/k8e-airgap-images.tar.gz release-artifacts/
fi
- name: Upload artifacts
uses: actions/upload-artifact@v5
with:
name: k8e
path: release-artifacts/
# ── K8E server binary: linux/arm64 ──────────────────────────────────
build-k8e-arm64:
name: Build k8e (arm64)
runs-on: ubuntu-24.04-arm
env:
GOOS: linux
GOARCH: arm64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
cache-dependency-path: go.sum
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config build-essential libc6-dev zlib1g-dev libseccomp-dev
- name: Generate resources
run: |
mkdir -p build/data build/static
make deps
zig build download
make generate
- name: Build k8e
run: make k8e
- name: Package CLI (data tarball)
run: make package-cli
- name: Rename artifact
run: |
mkdir -p release-artifacts
cp dist/artifacts/k8e-arm64 release-artifacts/k8e
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: k8e-arm64
path: release-artifacts/k8e
# ── Sandbox CLI: cross-platform binaries ──────────────────────────────
build-sandbox-cli:
name: Build sandbox-cli
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
cache-dependency-path: go.sum
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Build sandbox-cli
run: zig build sandboxcli
- name: Upload linux-amd64
uses: actions/upload-artifact@v5
with:
name: sandbox-cli-linux-amd64
path: zig-out/bin/k8e-sandbox-cli-linux-amd64
- name: Upload linux-arm64
uses: actions/upload-artifact@v5
with:
name: sandbox-cli-linux-arm64
path: zig-out/bin/k8e-sandbox-cli-linux-arm64
- name: Upload darwin-amd64
uses: actions/upload-artifact@v5
with:
name: sandbox-cli-darwin-amd64
path: zig-out/bin/k8e-sandbox-cli-darwin-amd64
- name: Upload darwin-arm64
uses: actions/upload-artifact@v5
with:
name: sandbox-cli-darwin-arm64
path: zig-out/bin/k8e-sandbox-cli-darwin-arm64
- name: Upload windows-amd64
uses: actions/upload-artifact@v5
with:
name: sandbox-cli-windows-amd64
path: zig-out/bin/k8e-sandbox-cli-windows-amd64.exe
# ── Sandbox container image ───────────────────────────────────────────
build-sandbox-image:
name: Build sandbox image
runs-on: ubuntu-latest
needs: build-k8e
env:
# docker/build-push-action uploads the exported build record as a run
# artifact (*.dockerbuild) by default. Keep the run's artifacts limited
# to what the publish job downloads by name/pattern.
DOCKER_BUILD_RECORD_UPLOAD: false
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Build sandboxd binaries
run: cd sandboxd && zig build sandboxd
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Sanitize tag
id: tag
run: echo "value=$(echo '${{ github.ref_name }}' | tr '+' '-')" >> $GITHUB_OUTPUT
- name: Build and push sandbox image
uses: docker/build-push-action@v7
with:
context: .
file: sandbox/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/xiaods/k8e-sandbox:${{ steps.tag.outputs.value }}
ghcr.io/xiaods/k8e-sandbox:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Verify sandbox image architecture
run: |
echo "Verifying sandbox image platforms..."
docker buildx imagetools inspect ghcr.io/xiaods/k8e-sandbox:latest
# ── MCP adapter image ────────────────────────────────────────────────
build-mcp-image:
name: Build MCP image
runs-on: ubuntu-latest
env:
# Same as build-sandbox-image: no *.dockerbuild build-record artifact.
DOCKER_BUILD_RECORD_UPLOAD: false
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Sanitize tag
id: tag
run: echo "value=$(echo '${{ github.ref_name }}' | tr '+' '-')" >> $GITHUB_OUTPUT
- name: Build and push MCP image
uses: docker/build-push-action@v7
with:
context: .
file: manifests/sandbox-mcp/Dockerfile
# Same arches as the sandbox image: the Deployment may run on arm64
# nodes once the multi-node work in KIP-30 lands.
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/xiaods/k8e-mcp:${{ steps.tag.outputs.value }}
ghcr.io/xiaods/k8e-mcp:latest
cache-from: type=gha
cache-to: type=gha,mode=max
# ── Publish all artifacts on the GitHub Release ─────────────────────
publish:
name: Publish release assets
runs-on: ubuntu-latest
needs: [build-k8e, build-k8e-arm64, build-sandbox-cli]
steps:
# Select artifacts explicitly. Without name/artifact-ids/pattern the
# step downloads every artifact in the run, including the *.dockerbuild
# build records the image jobs would otherwise upload. The two k8e
# artifacts both contain a file named "k8e", so they are downloaded into
# separate paths; a single flat merge would make them clobber each other.
- name: Download k8e amd64 artifact
uses: actions/download-artifact@v8
with:
name: k8e
path: release-artifacts
- name: Download k8e arm64 artifact
uses: actions/download-artifact@v8
with:
name: k8e-arm64
path: tmp-k8e-arm64
- name: Download sandbox-cli artifacts
uses: actions/download-artifact@v8
with:
pattern: sandbox-cli-*
merge-multiple: true
path: release-artifacts
- name: Stage release assets
run: |
# download-artifact@v8 extracts a single named artifact flat into
# its path, so the arm64 binary landed at tmp-k8e-arm64/k8e. Publish
# it as k8e-arm64: contrib/install.sh on aarch64 requests exactly
# that asset name.
mv tmp-k8e-arm64/k8e release-artifacts/k8e-arm64
rm -rf tmp-k8e-arm64
- name: Generate unified SHA256SUMS
run: |
cd release-artifacts
sha256sum * 2>/dev/null | sort > SHA256SUMS
echo "--- SHA256SUMS ---"
cat SHA256SUMS
- name: Generate per-arch checksums for contrib/install.sh
run: |
cd release-artifacts
# install.sh fetches sha256sum-<ARCH>.txt, greps the binary name for
# that arch (k8e on amd64, k8e-arm64 on aarch64) and aborts the
# install on a digest mismatch, so each file must carry that arch's
# real digest.
sha256sum k8e | awk '{print $1, $2}' > sha256sum-amd64.txt
sha256sum k8e-arm64 | awk '{print $1, $2}' > sha256sum-arm64.txt
- name: List artifacts
run: ls -la release-artifacts/
- name: Upload to release
uses: softprops/action-gh-release@v2.6.1
with:
files: |
release-artifacts/k8e
release-artifacts/k8e-arm64
release-artifacts/k8e-airgap-images.tar.gz
release-artifacts/k8e-sandbox-cli-linux-amd64
release-artifacts/k8e-sandbox-cli-linux-arm64
release-artifacts/k8e-sandbox-cli-darwin-amd64
release-artifacts/k8e-sandbox-cli-darwin-arm64
release-artifacts/k8e-sandbox-cli-windows-amd64.exe
release-artifacts/SHA256SUMS
release-artifacts/sha256sum-amd64.txt
release-artifacts/sha256sum-arm64.txt
fail_on_unmatched_files: false