-
Notifications
You must be signed in to change notification settings - Fork 654
946 lines (830 loc) · 32.7 KB
/
release-dev.yml
File metadata and controls
946 lines (830 loc) · 32.7 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
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
name: Release Dev
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
packages: write
defaults:
run:
shell: bash
jobs:
# ---------------------------------------------------------------------------
# Compute all versions once at the start to avoid git-describe race conditions
# ---------------------------------------------------------------------------
compute-versions:
name: Compute Versions
runs-on: linux-amd64-cpu8
timeout-minutes: 5
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
outputs:
python_version: ${{ steps.v.outputs.python }}
cargo_version: ${{ steps.v.outputs.cargo }}
deb_version: ${{ steps.v.outputs.deb }}
rpm_version: ${{ steps.v.outputs.rpm_version }}
rpm_release: ${{ steps.v.outputs.rpm_release }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Fetch tags
run: git fetch --tags --force
- name: Compute all versions
id: v
run: |
set -euo pipefail
echo "python=$(uv run python tasks/scripts/release.py get-version --python)" >> "$GITHUB_OUTPUT"
echo "cargo=$(uv run python tasks/scripts/release.py get-version --cargo)" >> "$GITHUB_OUTPUT"
echo "deb=$(uv run python tasks/scripts/release.py get-version --deb)" >> "$GITHUB_OUTPUT"
echo "rpm_version=$(uv run python tasks/scripts/release.py get-version --rpm-version)" >> "$GITHUB_OUTPUT"
echo "rpm_release=$(uv run python tasks/scripts/release.py get-version --rpm-release)" >> "$GITHUB_OUTPUT"
build-gateway:
needs: [compute-versions]
uses: ./.github/workflows/docker-build.yml
with:
component: gateway
cargo-version: ${{ needs.compute-versions.outputs.cargo_version }}
build-supervisor:
needs: [compute-versions]
uses: ./.github/workflows/docker-build.yml
with:
component: supervisor
cargo-version: ${{ needs.compute-versions.outputs.cargo_version }}
e2e:
needs: [build-gateway, build-supervisor]
uses: ./.github/workflows/e2e-test.yml
with:
image-tag: ${{ github.sha }}
runner: linux-arm64-cpu8
tag-ghcr-dev:
name: Tag GHCR Images as Dev
needs: [build-gateway, build-supervisor]
runs-on: linux-amd64-cpu8
timeout-minutes: 10
steps:
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Tag images as dev
run: |
set -euo pipefail
REGISTRY="ghcr.io/nvidia/openshell"
for component in gateway supervisor; do
echo "Tagging ${REGISTRY}/${component}:${{ github.sha }} as dev..."
docker buildx imagetools create \
--prefer-index=false \
-t "${REGISTRY}/${component}:dev" \
"${REGISTRY}/${component}:${{ github.sha }}"
done
build-python-wheels-linux:
name: Build Python Wheels (Linux ${{ matrix.arch }})
needs: [compute-versions]
strategy:
matrix:
include:
- arch: amd64
runner: linux-amd64-cpu8
artifact: linux-amd64
task: python:build:linux:amd64
output_path: target/wheels/linux-amd64/*.whl
- arch: arm64
runner: linux-arm64-cpu8
artifact: linux-arm64
task: python:build:linux:arm64
output_path: target/wheels/linux-arm64/*.whl
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENSHELL_IMAGE_TAG: dev
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Sync Python dependencies
run: uv sync
- name: Cache Rust target and registry
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
shared-key: python-wheel-linux-${{ matrix.arch }}
cache-directories: .cache/sccache
cache-targets: "true"
- name: Build Python wheels
run: |
set -euo pipefail
OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" mise run ${{ matrix.task }}
ls -la ${{ matrix.output_path }}
- name: Upload wheel artifacts
uses: actions/upload-artifact@v7
with:
name: python-wheels-${{ matrix.artifact }}
path: ${{ matrix.output_path }}
retention-days: 5
build-python-wheel-macos:
name: Build Python Wheel (macOS)
needs: [compute-versions]
runs-on: linux-amd64-cpu8
timeout-minutes: 120
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
volumes:
- /var/run/docker.sock:/var/run/docker.sock
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENSHELL_IMAGE_TAG: dev
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Set up Docker Buildx
uses: ./.github/actions/setup-buildx
with:
driver: local
- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Sync Python dependencies
run: uv sync
- name: Build Python wheel
run: |
set -euo pipefail
OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" mise run python:build:macos
ls -la target/wheels/*.whl
- name: Upload wheel artifacts
uses: actions/upload-artifact@v7
with:
name: python-wheels-macos
path: target/wheels/*.whl
retention-days: 5
# ---------------------------------------------------------------------------
# Build CLI binaries (Linux musl — static, native on each arch)
#
# Builds run directly on the CI host (glibc Ubuntu). Zig provides musl
# C/C++ toolchains for bundled-z3 and ring, and is also used as the linker.
# ---------------------------------------------------------------------------
build-cli-linux:
name: Build CLI (Linux ${{ matrix.arch }})
needs: [compute-versions]
strategy:
matrix:
include:
- arch: amd64
runner: linux-amd64-cpu8
target: x86_64-unknown-linux-musl
zig_target: x86_64-linux-musl
- arch: arm64
runner: linux-arm64-cpu8
target: aarch64-unknown-linux-musl
zig_target: aarch64-linux-musl
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENSHELL_IMAGE_TAG: dev
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Fetch tags
run: git fetch --tags --force
- name: Install tools
run: mise install --locked
- name: Cache Rust target and registry
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
shared-key: cli-musl-${{ matrix.arch }}
cache-directories: .cache/sccache
cache-targets: "true"
- name: Add Rust musl target
run: mise x -- rustup target add ${{ matrix.target }}
- name: Set up zig musl wrappers
run: |
set -euo pipefail
ZIG="$(mise which zig)"
ZIG_TARGET="${{ matrix.zig_target }}"
mkdir -p /tmp/zig-musl
# cc-rs injects --target=<rust-triple> (for example
# aarch64-unknown-linux-musl), which zig does not parse. Strip any
# caller-provided --target and use the wrapper's zig-native target.
for tool in cc c++; do
printf '#!/bin/bash\nargs=()\nfor arg in "$@"; do\n case "$arg" in\n --target=*) ;;\n *) args+=("$arg") ;;\n esac\ndone\nexec "%s" %s --target=%s "${args[@]}"\n' \
"$ZIG" "$tool" "$ZIG_TARGET" > "/tmp/zig-musl/${tool}"
chmod +x "/tmp/zig-musl/${tool}"
done
TARGET_ENV=$(echo "${{ matrix.target }}" | tr '-' '_')
TARGET_ENV_UPPER=${TARGET_ENV^^}
# Use zig for C/C++ compilation and final linking.
echo "CC_${TARGET_ENV}=/tmp/zig-musl/cc" >> "$GITHUB_ENV"
echo "CXX_${TARGET_ENV}=/tmp/zig-musl/c++" >> "$GITHUB_ENV"
echo "CARGO_TARGET_${TARGET_ENV_UPPER}_LINKER=/tmp/zig-musl/cc" >> "$GITHUB_ENV"
# Let zig own CRT/startfiles to avoid duplicate _start symbols.
echo "CARGO_TARGET_${TARGET_ENV_UPPER}_RUSTFLAGS=-Clink-self-contained=no" >> "$GITHUB_ENV"
# z3 built with zig c++ uses libc++ symbols (std::__1::*).
# Override z3-sys default (stdc++) so Rust links the matching runtime.
echo "CXXSTDLIB=c++" >> "$GITHUB_ENV"
- name: Patch workspace version
if: needs.compute-versions.outputs.cargo_version != ''
run: |
set -euo pipefail
sed -i -E '/^\[workspace\.package\]/,/^\[/{s/^version[[:space:]]*=[[:space:]]*".*"/version = "'"${{ needs.compute-versions.outputs.cargo_version }}"'"/}' Cargo.toml
- name: Build ${{ matrix.target }}
run: mise x -- cargo build --release --target ${{ matrix.target }} -p openshell-cli --features bundled-z3
- name: sccache stats
if: always()
run: mise x -- sccache --show-stats
- name: Package binary
run: |
set -euo pipefail
mkdir -p artifacts
tar -czf artifacts/openshell-${{ matrix.target }}.tar.gz \
-C target/${{ matrix.target }}/release openshell
ls -lh artifacts/
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: cli-linux-${{ matrix.arch }}
path: artifacts/*.tar.gz
retention-days: 5
# ---------------------------------------------------------------------------
# Build CLI binary (macOS aarch64 via osxcross)
# ---------------------------------------------------------------------------
build-cli-macos:
name: Build CLI (macOS)
needs: [compute-versions]
runs-on: linux-amd64-cpu8
timeout-minutes: 60
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
volumes:
- /var/run/docker.sock:/var/run/docker.sock
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Fetch tags
run: git fetch --tags --force
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Set up Docker Buildx
uses: ./.github/actions/setup-buildx
with:
driver: local
- name: Build macOS binary via Docker
run: |
set -euo pipefail
docker buildx build \
--file deploy/docker/Dockerfile.cli-macos \
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
--build-arg OPENSHELL_IMAGE_TAG=dev \
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \
--target binary \
--output type=local,dest=out/ \
.
- name: Package binary
run: |
set -euo pipefail
mkdir -p artifacts
tar -czf artifacts/openshell-aarch64-apple-darwin.tar.gz \
-C out openshell
ls -lh artifacts/
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: cli-macos
path: artifacts/*.tar.gz
retention-days: 5
# ---------------------------------------------------------------------------
# Build standalone gateway binaries (Linux GNU — native on each arch)
# ---------------------------------------------------------------------------
build-gateway-binary-linux:
name: Build Gateway Binary (Linux ${{ matrix.arch }})
needs: [compute-versions]
strategy:
matrix:
include:
- arch: amd64
runner: linux-amd64-cpu8
target: x86_64-unknown-linux-gnu
- arch: arm64
runner: linux-arm64-cpu8
target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Fetch tags
run: git fetch --tags --force
- name: Install tools
run: mise install --locked
- name: Cache Rust target and registry
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
shared-key: gateway-binary-gnu-${{ matrix.arch }}
cache-directories: .cache/sccache
cache-targets: "true"
- name: Patch workspace version
if: needs.compute-versions.outputs.cargo_version != ''
run: |
set -euo pipefail
sed -i -E '/^\[workspace\.package\]/,/^\[/{s/^version[[:space:]]*=[[:space:]]*".*"/version = "'"${{ needs.compute-versions.outputs.cargo_version }}"'"/}' Cargo.toml
- name: Build ${{ matrix.target }}
env:
OPENSHELL_IMAGE_TAG: ${{ github.sha }}
run: |
set -euo pipefail
mise x -- cargo build --release --target ${{ matrix.target }} -p openshell-server
- name: Verify packaged binary
run: |
set -euo pipefail
OUTPUT="$(target/${{ matrix.target }}/release/openshell-gateway --version)"
echo "$OUTPUT"
grep -q '^openshell-gateway ' <<<"$OUTPUT"
- name: sccache stats
if: always()
run: mise x -- sccache --show-stats
- name: Package binary
run: |
set -euo pipefail
mkdir -p artifacts
tar -czf artifacts/openshell-gateway-${{ matrix.target }}.tar.gz \
-C target/${{ matrix.target }}/release openshell-gateway
ls -lh artifacts/
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: gateway-binary-linux-${{ matrix.arch }}
path: artifacts/*.tar.gz
retention-days: 5
# ---------------------------------------------------------------------------
# Build standalone gateway binary (macOS aarch64 via osxcross)
# ---------------------------------------------------------------------------
build-gateway-binary-macos:
name: Build Gateway Binary (macOS)
needs: [compute-versions]
runs-on: linux-amd64-cpu8
timeout-minutes: 60
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
volumes:
- /var/run/docker.sock:/var/run/docker.sock
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Fetch tags
run: git fetch --tags --force
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Set up Docker Buildx
uses: ./.github/actions/setup-buildx
with:
driver: local
- name: Build macOS binary via Docker
run: |
set -euo pipefail
docker buildx build \
--file deploy/docker/Dockerfile.gateway-macos \
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \
--target binary \
--output type=local,dest=out/ \
.
- name: Verify packaged binary shape
run: |
set -euo pipefail
test -x out/openshell-gateway
- name: Package binary
run: |
set -euo pipefail
mkdir -p artifacts
tar -czf artifacts/openshell-gateway-aarch64-apple-darwin.tar.gz \
-C out openshell-gateway
ls -lh artifacts/
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: gateway-binary-macos
path: artifacts/*.tar.gz
retention-days: 5
# ---------------------------------------------------------------------------
# Build standalone supervisor binaries (Linux GNU — native on each arch)
# ---------------------------------------------------------------------------
build-supervisor-binary-linux:
name: Build Supervisor Binary (Linux ${{ matrix.arch }})
needs: [compute-versions]
strategy:
matrix:
include:
- arch: amd64
runner: linux-amd64-cpu8
target: x86_64-unknown-linux-gnu
- arch: arm64
runner: linux-arm64-cpu8
target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Fetch tags
run: git fetch --tags --force
- name: Install tools
run: mise install --locked
- name: Cache Rust target and registry
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
shared-key: supervisor-binary-gnu-${{ matrix.arch }}
cache-directories: .cache/sccache
cache-targets: "true"
- name: Patch workspace version
if: needs.compute-versions.outputs.cargo_version != ''
run: |
set -euo pipefail
sed -i -E '/^\[workspace\.package\]/,/^\[/{s/^version[[:space:]]*=[[:space:]]*".*"/version = "'"${{ needs.compute-versions.outputs.cargo_version }}"'"/}' Cargo.toml
- name: Build ${{ matrix.target }}
run: |
set -euo pipefail
mise x -- cargo build --release --target ${{ matrix.target }} -p openshell-sandbox --bin openshell-sandbox
- name: Verify packaged binary
run: |
set -euo pipefail
OUTPUT="$(target/${{ matrix.target }}/release/openshell-sandbox --version)"
echo "$OUTPUT"
grep -q '^openshell-sandbox ' <<<"$OUTPUT"
- name: sccache stats
if: always()
run: mise x -- sccache --show-stats
- name: Package binary
run: |
set -euo pipefail
mkdir -p artifacts
tar -czf artifacts/openshell-sandbox-${{ matrix.target }}.tar.gz \
-C target/${{ matrix.target }}/release openshell-sandbox
ls -lh artifacts/
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: supervisor-binary-linux-${{ matrix.arch }}
path: artifacts/*.tar.gz
retention-days: 5
build-driver-vm-linux:
name: Build Driver VM Linux
needs: [compute-versions]
uses: ./.github/workflows/driver-vm-linux.yml
with:
cargo-version: ${{ needs.compute-versions.outputs.cargo_version }}
image-tag: dev
checkout-ref: ${{ github.sha }}
secrets: inherit
build-driver-vm-macos:
name: Build Driver VM macOS
needs: [compute-versions]
uses: ./.github/workflows/driver-vm-macos.yml
with:
cargo-version: ${{ needs.compute-versions.outputs.cargo_version }}
image-tag: dev
checkout-ref: ${{ github.sha }}
secrets: inherit
build-deb:
name: Build Debian Packages
needs: [compute-versions, build-cli-linux, build-gateway-binary-linux, build-driver-vm-linux]
uses: ./.github/workflows/deb-package.yml
with:
deb-version: ${{ needs.compute-versions.outputs.deb_version }}
checkout-ref: ${{ github.sha }}
secrets: inherit
build-rpm:
name: Build RPM Packages
needs: [compute-versions]
uses: ./.github/workflows/rpm-package.yml
with:
checkout-ref: ${{ github.sha }}
rpm-version: ${{ needs.compute-versions.outputs.rpm_version }}
rpm-release: ${{ needs.compute-versions.outputs.rpm_release }}
cargo-version: ${{ needs.compute-versions.outputs.cargo_version }}
secrets: inherit
# ---------------------------------------------------------------------------
# Create / update the dev GitHub Release with CLI, gateway, driver, and wheels
# ---------------------------------------------------------------------------
release-dev:
name: Release Dev
needs: [compute-versions, build-cli-linux, build-cli-macos, build-gateway-binary-linux, build-gateway-binary-macos, build-supervisor-binary-linux, build-python-wheels-linux, build-python-wheel-macos, build-driver-vm-linux, build-driver-vm-macos, build-deb, build-rpm]
runs-on: linux-amd64-cpu8
timeout-minutes: 10
permissions:
contents: write
id-token: write
attestations: write
artifact-metadata: write
outputs:
wheel_filenames: ${{ steps.wheel_filenames.outputs.wheel_filenames }}
steps:
- uses: actions/checkout@v6
- name: Download all CLI artifacts
uses: actions/download-artifact@v4
with:
pattern: cli-*
path: release/
merge-multiple: true
- name: Download gateway binary artifacts
uses: actions/download-artifact@v4
with:
pattern: gateway-binary-*
path: release/
merge-multiple: true
- name: Download supervisor binary artifacts
uses: actions/download-artifact@v4
with:
pattern: supervisor-binary-*
path: release/
merge-multiple: true
- name: Download VM driver artifacts
uses: actions/download-artifact@v4
with:
pattern: driver-vm-*
path: release/
merge-multiple: true
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
pattern: python-wheels-*
path: release/
merge-multiple: true
- name: Download Debian package artifacts
uses: actions/download-artifact@v4
with:
pattern: deb-linux-*
path: release/
merge-multiple: true
- name: Download RPM package artifacts
uses: actions/download-artifact@v4
with:
pattern: rpm-linux-*
path: release/
merge-multiple: true
- name: Normalize dev package filenames
run: |
set -euo pipefail
shopt -s nullglob
move_one() {
local dest="$1"
shift
local matches=("$@")
if [ "${#matches[@]}" -ne 1 ]; then
echo "expected exactly one source for ${dest}, found ${#matches[@]}: ${matches[*]-}" >&2
exit 1
fi
mv "${matches[0]}" "release/${dest}"
}
move_one openshell-dev-amd64.deb release/openshell_*_amd64.deb
move_one openshell-dev-arm64.deb release/openshell_*_arm64.deb
move_one openshell-dev-x86_64.rpm release/openshell-[0-9]*.x86_64.rpm
move_one openshell-dev-aarch64.rpm release/openshell-[0-9]*.aarch64.rpm
move_one openshell-gateway-dev-x86_64.rpm release/openshell-gateway-[0-9]*.x86_64.rpm
move_one openshell-gateway-dev-aarch64.rpm release/openshell-gateway-[0-9]*.aarch64.rpm
ls -la release/
- name: Capture wheel filenames
id: wheel_filenames
run: |
set -euo pipefail
ls -la release/*.whl
WHEEL_FILENAMES=$(ls release/*.whl | xargs -n1 basename | sort | paste -sd, -)
echo "wheel_filenames=${WHEEL_FILENAMES}" >> "$GITHUB_OUTPUT"
- name: Generate checksums
run: |
set -euo pipefail
cd release
sha256sum \
openshell-x86_64-unknown-linux-musl.tar.gz \
openshell-aarch64-unknown-linux-musl.tar.gz \
openshell-aarch64-apple-darwin.tar.gz \
openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz \
openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz \
openshell-driver-vm-aarch64-apple-darwin.tar.gz \
*.deb \
openshell-*.rpm \
*.whl > openshell-checksums-sha256.txt
cat openshell-checksums-sha256.txt
sha256sum \
openshell-gateway-x86_64-unknown-linux-gnu.tar.gz \
openshell-gateway-aarch64-unknown-linux-gnu.tar.gz \
openshell-gateway-aarch64-apple-darwin.tar.gz > openshell-gateway-checksums-sha256.txt
cat openshell-gateway-checksums-sha256.txt
sha256sum \
openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz \
openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz > openshell-sandbox-checksums-sha256.txt
cat openshell-sandbox-checksums-sha256.txt
- name: Generate Homebrew formula
run: |
set -euo pipefail
python3 tasks/scripts/release.py generate-homebrew-formula \
--release-tag dev \
--release-dir release \
--output release/openshell.rb
cat release/openshell.rb
- name: Attest VM driver artifacts
uses: actions/attest@v4
with:
subject-path: |
release/openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz
release/openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz
release/openshell-driver-vm-aarch64-apple-darwin.tar.gz
- name: Prune managed assets from dev release
uses: actions/github-script@v9
with:
script: |
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
// Fetch the dev release
let release;
try {
release = await github.rest.repos.getReleaseByTag({ owner, repo, tag: 'dev' });
} catch (err) {
if (err.status === 404) {
core.info('No existing dev release found; skipping wheel pruning.');
return;
}
throw err;
}
const assets = release.data.assets;
core.info(`=== Current dev release assets (${assets.length} total) ===`);
for (const a of assets) {
core.info(` ${String(a.id).padStart(12)} ${a.name}`);
}
const managed = (name) => (
name.startsWith('openshell') &&
(
name.endsWith('.tar.gz') ||
name.endsWith('.txt') ||
name.endsWith('.whl') ||
name.endsWith('.deb') ||
name.endsWith('.rpm')
)
);
let deleted = 0, skipped = 0;
for (const asset of assets) {
if (managed(asset.name)) {
core.info(`Deleting managed dev asset: ${asset.name} (id=${asset.id})`);
await github.rest.repos.deleteReleaseAsset({ owner, repo, asset_id: asset.id });
deleted++;
} else {
core.info(`Skipping unmanaged asset: ${asset.name}`);
skipped++;
}
}
core.info(`Summary: deleted=${deleted}, skipped=${skipped}`);
- name: Move dev tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -fa dev -m "Latest Dev" "${GITHUB_SHA}"
git push --force origin dev
- name: Create / update GitHub Release
uses: softprops/action-gh-release@v2
with:
name: OpenShell Development Build
prerelease: true
tag_name: dev
target_commitish: ${{ github.sha }}
body: |
This build is automatically published on every commit to main that passes CI.
> **NOTE**: This is a development build, not a tagged release, and may be unstable.
### Quick install
```
curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | OPENSHELL_VERSION=dev sh
```
files: |
release/openshell-x86_64-unknown-linux-musl.tar.gz
release/openshell-aarch64-unknown-linux-musl.tar.gz
release/openshell-aarch64-apple-darwin.tar.gz
release/openshell-dev-amd64.deb
release/openshell-dev-arm64.deb
release/openshell-*.rpm
release/openshell-gateway-x86_64-unknown-linux-gnu.tar.gz
release/openshell-gateway-aarch64-unknown-linux-gnu.tar.gz
release/openshell-gateway-aarch64-apple-darwin.tar.gz
release/openshell-sandbox-x86_64-unknown-linux-gnu.tar.gz
release/openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz
release/openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz
release/openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz
release/openshell-driver-vm-aarch64-apple-darwin.tar.gz
release/*.whl
release/openshell.rb
release/openshell-checksums-sha256.txt
release/openshell-gateway-checksums-sha256.txt
release/openshell-sandbox-checksums-sha256.txt
release-helm:
name: Release Helm Chart (OCI, dev)
needs: [tag-ghcr-dev]
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
packages: write
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/release-helm-oci
with:
chart-version: 0.0.0-dev
app-version: dev
release-kind: dev
pin-sha: ${{ github.sha }}
trigger-wheel-publish:
name: Trigger Wheel Publish
needs: [compute-versions, release-dev]
runs-on: [self-hosted, nv]
timeout-minutes: 10
steps:
- name: Trigger GitLab CI
env:
GITLAB_CI_TRIGGER_TOKEN: ${{ secrets.GITLAB_CI_TRIGGER_TOKEN }}
GITLAB_CI_TRIGGER_URL: ${{ secrets.GITLAB_CI_TRIGGER_URL }}
RELEASE_VERSION: ${{ needs.compute-versions.outputs.python_version }}
WHEEL_FILENAMES: ${{ needs.release-dev.outputs.wheel_filenames }}
run: |
set -euo pipefail
if [ -z "${WHEEL_FILENAMES}" ]; then
echo "No wheel filenames provided by build job" >&2
exit 1
fi
response=$(curl -X POST \
--fail \
--silent \
--show-error \
-F "token=${GITLAB_CI_TRIGGER_TOKEN}" \
-F "ref=main" \
-F "variables[PIPELINE_ACTION]=publish_wheels" \
-F "variables[GITHUB_REPOSITORY]=${GITHUB_REPOSITORY}" \
-F "variables[COMMIT_SHA]=${GITHUB_SHA}" \
-F "variables[RELEASE_TAG]=dev" \
-F "variables[RELEASE_VERSION]=${RELEASE_VERSION}" \
-F "variables[RELEASE_KIND]=dev" \
-F "variables[WHEEL_FILENAMES]=${WHEEL_FILENAMES}" \
"${GITLAB_CI_TRIGGER_URL}")
pipeline_id=$(printf '%s' "$response" | sed -n 's/.*"id":\([0-9][0-9]*\).*/\1/p')
pipeline_status=$(printf '%s' "$response" | sed -n 's/.*"status":"\([^"]*\)".*/\1/p')
echo "Triggered GitLab pipeline ${pipeline_id:-unknown} with status=${pipeline_status:-unknown}"