forked from wecode-ai/Wegent
-
Notifications
You must be signed in to change notification settings - Fork 0
924 lines (802 loc) · 30.3 KB
/
publish-image.yml
File metadata and controls
924 lines (802 loc) · 30.3 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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
# SPDX-FileCopyrightText: 2025 Weibo, Inc.
#
# SPDX-License-Identifier: Apache-2.0
name: Publish Image
on:
pull_request:
types: [closed]
workflow_dispatch:
inputs:
version:
description: 'Custom version to release (e.g. 1.2.3). If empty, auto-increment from latest git tag'
type: string
required: false
env:
GIT_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.merge_commit_sha || 'main' }}
REGISTRY: ghcr.io
IMAGE_PREFIX: ghcr.io/${{ github.repository_owner }}
concurrency:
group: publish-image
cancel-in-progress: false
jobs:
prepare-release:
runs-on: ubuntu-latest
permissions:
contents: read
if: >
( github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'main' &&
github.event.pull_request.merged == true &&
contains(github.event.pull_request.title, 'Changeset version bump') ) ||
github.event_name == 'workflow_dispatch'
outputs:
new_version: ${{ steps.get_version.outputs.version }}
steps:
- name: Checkout code (full history for version detection)
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
fetch-depth: 0
- name: Get version from git tags (and bump patch)
id: get_version
shell: bash
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
set -euo pipefail
# If custom version is provided, use it directly
if [ -n "${INPUT_VERSION:-}" ]; then
echo "Using custom version: ${INPUT_VERSION}"
echo "version=${INPUT_VERSION}" >> "$GITHUB_OUTPUT"
exit 0
fi
# Get the latest version tag (format: vX.X.X)
LATEST_TAG=$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -1 || true)
if [ -z "$LATEST_TAG" ]; then
echo "No existing version tags found, starting from v0.0.1"
echo "version=0.0.1" >> "$GITHUB_OUTPUT"
exit 0
fi
# Remove 'v' prefix
VERSION="${LATEST_TAG#v}"
echo "Current version: $VERSION (from tag $LATEST_TAG)"
IFS='.' read -ra VERSION_PARTS <<< "$VERSION"
if [ ${#VERSION_PARTS[@]} -ne 3 ]; then
echo "Error: Invalid version format '$VERSION'. Expected MAJOR.MINOR.PATCH"
exit 1
fi
MAJOR=${VERSION_PARTS[0]}
MINOR=${VERSION_PARTS[1]}
PATCH=${VERSION_PARTS[2]}
if ! [[ "$PATCH" =~ ^[0-9]+$ ]]; then
echo "Error: PATCH '$PATCH' is not a number"
exit 1
fi
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
echo "New version: $NEW_VERSION"
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
# ============================================================================
# Backend Image Build (parallel AMD64 + ARM64)
# ============================================================================
build-backend-amd64:
needs: prepare-release
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push backend image (amd64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/backend/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ env.IMAGE_PREFIX }}/wegent-backend:${{ needs.prepare-release.outputs.new_version }}-amd64
cache-from: type=gha,scope=backend-amd64
cache-to: type=gha,mode=max,scope=backend-amd64
build-backend-arm64:
needs: prepare-release
runs-on: ubuntu-24.04-arm
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push backend image (arm64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/backend/Dockerfile
push: true
platforms: linux/arm64
tags: ${{ env.IMAGE_PREFIX }}/wegent-backend:${{ needs.prepare-release.outputs.new_version }}-arm64
cache-from: type=gha,scope=backend-arm64
cache-to: type=gha,mode=max,scope=backend-arm64
# ============================================================================
# Executor Image Build (parallel AMD64 + ARM64)
# ============================================================================
build-executor-amd64:
needs: prepare-release
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push executor image (amd64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/executor/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ env.IMAGE_PREFIX }}/wegent-executor:${{ needs.prepare-release.outputs.new_version }}-amd64
cache-from: type=gha,scope=executor-amd64
cache-to: type=gha,mode=max,scope=executor-amd64
build-executor-arm64:
needs: prepare-release
runs-on: ubuntu-24.04-arm
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push executor image (arm64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/executor/Dockerfile
push: true
platforms: linux/arm64
tags: ${{ env.IMAGE_PREFIX }}/wegent-executor:${{ needs.prepare-release.outputs.new_version }}-arm64
cache-from: type=gha,scope=executor-arm64
cache-to: type=gha,mode=max,scope=executor-arm64
# ============================================================================
# Executor Manager Image Build (parallel AMD64 + ARM64)
# ============================================================================
build-executor-manager-amd64:
needs: prepare-release
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push executor-manager image (amd64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/executor_manager/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ env.IMAGE_PREFIX }}/wegent-executor-manager:${{ needs.prepare-release.outputs.new_version }}-amd64
cache-from: type=gha,scope=executor-manager-amd64
cache-to: type=gha,mode=max,scope=executor-manager-amd64
build-executor-manager-arm64:
needs: prepare-release
runs-on: ubuntu-24.04-arm
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push executor-manager image (arm64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/executor_manager/Dockerfile
push: true
platforms: linux/arm64
tags: ${{ env.IMAGE_PREFIX }}/wegent-executor-manager:${{ needs.prepare-release.outputs.new_version }}-arm64
cache-from: type=gha,scope=executor-manager-arm64
cache-to: type=gha,mode=max,scope=executor-manager-arm64
# ============================================================================
# Frontend Image Build (parallel AMD64 + ARM64)
# ============================================================================
build-frontend-amd64:
needs: prepare-release
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push frontend image (amd64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/frontend/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ env.IMAGE_PREFIX }}/wegent-web:${{ needs.prepare-release.outputs.new_version }}-amd64
cache-from: type=gha,scope=frontend-amd64
cache-to: type=gha,mode=max,scope=frontend-amd64
build-args: |
NEXT_TELEMETRY_DISABLED=1
APP_VERSION=${{ needs.prepare-release.outputs.new_version }}
build-frontend-arm64:
needs: prepare-release
runs-on: ubuntu-24.04-arm
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push frontend image (arm64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/frontend/Dockerfile
push: true
platforms: linux/arm64
tags: ${{ env.IMAGE_PREFIX }}/wegent-web:${{ needs.prepare-release.outputs.new_version }}-arm64
cache-from: type=gha,scope=frontend-arm64
cache-to: type=gha,mode=max,scope=frontend-arm64
build-args: |
NEXT_TELEMETRY_DISABLED=1
APP_VERSION=${{ needs.prepare-release.outputs.new_version }}
# ============================================================================
# Chat Shell Image Build (parallel AMD64 + ARM64)
# ============================================================================
build-chat-shell-amd64:
needs: prepare-release
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push chat-shell image (amd64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/chat_shell/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ env.IMAGE_PREFIX }}/wegent-chat-shell:${{ needs.prepare-release.outputs.new_version }}-amd64
cache-from: type=gha,scope=chat-shell-amd64
cache-to: type=gha,mode=max,scope=chat-shell-amd64
build-chat-shell-arm64:
needs: prepare-release
runs-on: ubuntu-24.04-arm
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push chat-shell image (arm64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/chat_shell/Dockerfile
push: true
platforms: linux/arm64
tags: ${{ env.IMAGE_PREFIX }}/wegent-chat-shell:${{ needs.prepare-release.outputs.new_version }}-arm64
cache-from: type=gha,scope=chat-shell-arm64
cache-to: type=gha,mode=max,scope=chat-shell-arm64
# ============================================================================
# Standalone Image Build (parallel AMD64 + ARM64)
# Single image containing Backend, Frontend, Chat Shell, and Executor
# ============================================================================
build-standalone-amd64:
needs: prepare-release
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push standalone image (amd64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/standalone/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ env.IMAGE_PREFIX }}/wegent-standalone:${{ needs.prepare-release.outputs.new_version }}-amd64
cache-from: type=gha,scope=standalone-amd64
cache-to: type=gha,mode=max,scope=standalone-amd64
build-args: |
APP_VERSION=${{ needs.prepare-release.outputs.new_version }}
build-standalone-arm64:
needs: prepare-release
runs-on: ubuntu-24.04-arm
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push standalone image (arm64)
uses: docker/build-push-action@v5
with:
context: .
file: docker/standalone/Dockerfile
push: true
platforms: linux/arm64
tags: ${{ env.IMAGE_PREFIX }}/wegent-standalone:${{ needs.prepare-release.outputs.new_version }}-arm64
cache-from: type=gha,scope=standalone-arm64
cache-to: type=gha,mode=max,scope=standalone-arm64
build-args: |
APP_VERSION=${{ needs.prepare-release.outputs.new_version }}
# ============================================================================
# Executor Local Binary Build (macOS)
# ============================================================================
build-executor-local-macos-arm64:
needs: prepare-release
runs-on: macos-14 # Apple Silicon runner
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies and build
working-directory: executor
env:
GITHUB_REPO: ${{ github.repository }}
run: |
uv sync --group build
uv run python scripts/build_local.py --version ${{ needs.prepare-release.outputs.new_version }}
- name: Rename binary with platform suffix
run: |
mv executor/dist/wegent-executor executor/dist/wegent-executor-macos-arm64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: wegent-executor-macos-arm64
path: executor/dist/wegent-executor-macos-arm64
retention-days: 1
build-executor-local-macos-amd64:
needs: prepare-release
runs-on: macos-14 # Apple Silicon runner with Rosetta 2 for x86_64 build
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Install Rosetta 2
run: |
# Check if Rosetta 2 is already installed
if ! /usr/bin/pgrep -q oahd; then
sudo softwareupdate --install-rosetta --agree-to-license || true
fi
- name: Set up Python (x86_64 via Rosetta)
run: |
# Download and install Python for x86_64
curl -L -o python-installer.pkg "https://www.python.org/ftp/python/3.11.9/python-3.11.9-macos11.pkg"
sudo installer -pkg python-installer.pkg -target /
rm python-installer.pkg
- name: Install uv (x86_64)
run: |
arch -x86_64 /usr/local/bin/python3.11 -m pip install --upgrade pip
arch -x86_64 /usr/local/bin/python3.11 -m pip install uv
- name: Install dependencies and build (x86_64)
working-directory: executor
env:
GITHUB_REPO: ${{ github.repository }}
run: |
# Use x86_64 Python and uv to install dependencies and build
arch -x86_64 /usr/local/bin/python3.11 -m uv sync --group build
arch -x86_64 /usr/local/bin/python3.11 -m uv run python scripts/build_local.py --version ${{ needs.prepare-release.outputs.new_version }}
- name: Rename binary with platform suffix
run: |
mv executor/dist/wegent-executor executor/dist/wegent-executor-macos-amd64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: wegent-executor-macos-amd64
path: executor/dist/wegent-executor-macos-amd64
retention-days: 1
# ============================================================================
# Executor Local Binary Build (Linux)
# Note: Using Ubuntu 22.04 for better GLIBC compatibility (GLIBC 2.35)
# This ensures the binary works on most Linux distributions including
# CentOS 7/8, RHEL, Debian 11+, Ubuntu 20.04+, etc.
# ============================================================================
build-executor-local-linux-amd64:
needs: prepare-release
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies and build
working-directory: executor
env:
GITHUB_REPO: ${{ github.repository }}
run: |
uv sync --group build
uv run python scripts/build_local.py --version ${{ needs.prepare-release.outputs.new_version }}
- name: Rename binary with platform suffix
run: |
mv executor/dist/wegent-executor executor/dist/wegent-executor-linux-amd64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: wegent-executor-linux-amd64
path: executor/dist/wegent-executor-linux-amd64
retention-days: 1
build-executor-local-linux-amd64-no-claude:
needs: prepare-release
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies and build without bundled Claude CLI
working-directory: executor
env:
GITHUB_REPO: ${{ github.repository }}
run: |
uv sync --group build
uv run python scripts/build_local.py --version ${{ needs.prepare-release.outputs.new_version }} --no-bundle-claude
- name: Rename binary with platform suffix
run: |
mv executor/dist/wegent-executor executor/dist/wegent-executor-linux-amd64-no-claude
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: wegent-executor-linux-amd64-no-claude
path: executor/dist/wegent-executor-linux-amd64-no-claude
retention-days: 1
build-executor-local-linux-arm64:
needs: prepare-release
runs-on: ubuntu-22.04-arm
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies and build
working-directory: executor
env:
GITHUB_REPO: ${{ github.repository }}
run: |
uv sync --group build
uv run python scripts/build_local.py --version ${{ needs.prepare-release.outputs.new_version }}
- name: Rename binary with platform suffix
run: |
mv executor/dist/wegent-executor executor/dist/wegent-executor-linux-arm64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: wegent-executor-linux-arm64
path: executor/dist/wegent-executor-linux-arm64
retention-days: 1
# ============================================================================
# Executor Local Binary Build (Windows)
# Note: Windows 10 1809+ required for ConPTY support
# ============================================================================
build-executor-local-windows-amd64:
needs: prepare-release
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies and build
working-directory: executor
shell: pwsh
env:
GITHUB_REPO: ${{ github.repository }}
run: |
uv sync --group build
uv run python scripts/build_local.py --version ${{ needs.prepare-release.outputs.new_version }}
- name: Rename binary with platform suffix
shell: pwsh
run: |
Move-Item executor/dist/wegent-executor.exe executor/dist/wegent-executor-windows-amd64.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: wegent-executor-windows-amd64
path: executor/dist/wegent-executor-windows-amd64.exe
retention-days: 1
# ============================================================================
# Create Multi-arch Manifests (combine amd64 + arm64 into single tag)
# ============================================================================
create-manifests:
needs:
- prepare-release
- build-backend-amd64
- build-backend-arm64
- build-executor-amd64
- build-executor-arm64
- build-executor-manager-amd64
- build-executor-manager-arm64
- build-frontend-amd64
- build-frontend-arm64
- build-chat-shell-amd64
- build-chat-shell-arm64
- build-standalone-amd64
- build-standalone-arm64
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create and push multi-arch manifests
env:
VERSION: ${{ needs.prepare-release.outputs.new_version }}
run: |
set -euo pipefail
# Function to create manifest for an image
create_manifest() {
local image_name=$1
echo "Creating manifest for ${image_name}..."
# Create versioned manifest
docker buildx imagetools create -t "${IMAGE_PREFIX}/${image_name}:${VERSION}" \
"${IMAGE_PREFIX}/${image_name}:${VERSION}-amd64" \
"${IMAGE_PREFIX}/${image_name}:${VERSION}-arm64"
# Create latest manifest
docker buildx imagetools create -t "${IMAGE_PREFIX}/${image_name}:latest" \
"${IMAGE_PREFIX}/${image_name}:${VERSION}-amd64" \
"${IMAGE_PREFIX}/${image_name}:${VERSION}-arm64"
echo "✅ Created manifests for ${image_name}:${VERSION} and ${image_name}:latest"
}
# Create manifests for all images
create_manifest "wegent-backend"
create_manifest "wegent-executor"
create_manifest "wegent-executor-manager"
create_manifest "wegent-web"
create_manifest "wegent-chat-shell"
create_manifest "wegent-standalone"
echo "🎉 All multi-arch manifests created successfully!"
# ============================================================================
# Create Release Tag (after all images are built and manifests created)
# ============================================================================
create-release-tag:
needs:
- prepare-release
- create-manifests
- build-executor-local-macos-arm64
- build-executor-local-macos-amd64
- build-executor-local-linux-amd64
- build-executor-local-linux-amd64-no-claude
- build-executor-local-linux-arm64
- build-executor-local-windows-amd64
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code (full history + tags)
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
fetch-depth: 0
- name: Download executor binaries
uses: actions/download-artifact@v4
with:
pattern: wegent-executor-*
path: ./executor-binaries
merge-multiple: true
- name: Create and push tag
shell: bash
run: |
set -euo pipefail
VERSION="${{ needs.prepare-release.outputs.new_version }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch --tags --force
if git rev-parse "v${VERSION}" >/dev/null 2>&1; then
echo "Tag v${VERSION} already exists, skipping tag creation"
else
git tag -a "v${VERSION}" -m "Release version ${VERSION}"
git push origin "v${VERSION}"
echo "Created and pushed tag v${VERSION}"
fi
- name: Generate Release Notes
id: release-notes
uses: actions/github-script@v7
env:
TAG: v${{ needs.prepare-release.outputs.new_version }}
with:
script: |
const tag = process.env.TAG;
if (!tag) {
core.setFailed('TAG env is missing; cannot generate release notes.');
return;
}
try {
const { data } = await github.rest.repos.generateReleaseNotes({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: tag,
});
core.setOutput("tag", tag);
core.setOutput("body", data.body || '');
} catch (error) {
core.setFailed(`Failed to generate release notes: ${error.message}`);
}
- name: Create GitHub Release
if: steps.release-notes.outputs.tag != ''
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.release-notes.outputs.tag }}
name: Release ${{ steps.release-notes.outputs.tag }}
body: ${{ steps.release-notes.outputs.body }}
draft: false
prerelease: false
files: |
./executor-binaries/wegent-executor-macos-arm64
./executor-binaries/wegent-executor-macos-amd64
./executor-binaries/wegent-executor-linux-amd64
./executor-binaries/wegent-executor-linux-amd64-no-claude
./executor-binaries/wegent-executor-linux-arm64
./executor-binaries/wegent-executor-windows-amd64.exe
./executor/scripts/local_executor_install.sh
./executor/scripts/local_executor_install.ps1