-
Notifications
You must be signed in to change notification settings - Fork 732
788 lines (761 loc) · 41.8 KB
/
release.yml
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
name: release
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "info"
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prep.outputs.version }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Get version
id: prep
run: |
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ steps.prep.outputs.version }} --draft --notes-file .CurrentChangelog.md --prerelease --title "WasmEdge ${{ steps.prep.outputs.version }}" --verify-tag
create_source_tarball:
needs: create_release
uses: ./.github/workflows/reusable-create-source-tarball.yml
with:
version: ${{ needs.create_release.outputs.version }}
release: true
secrets: inherit
build_on_macos:
needs: create_release
uses: ./.github/workflows/reusable-build-on-macos.yml
with:
version: ${{ needs.create_release.outputs.version }}
matrix:
"[{'name':'MacOS 12 (x86_64)','runner':'macos-12','darwin_version':21,'arch':'x86_64'},
{'name':'MacOS 13 (arm64)','runner':'mac-arm64','darwin_version':22,'arch':'arm64'}]"
release: true
secrets: inherit
build_on_ubuntu_20_04:
needs: create_release
uses: ./.github/workflows/reusable-build-on-ubuntu.yml
with:
version: ${{ needs.create_release.outputs.version }}
matrix: "[{'name':'ubuntu-20.04','compiler':'clang++','build_type':'Release','docker_tag':'ubuntu-20.04-build-clang'}]"
release: true
secrets: inherit
build_on_manylinux2014:
needs: create_release
uses: ./.github/workflows/reusable-build-on-manylinux.yml
with:
version: ${{ needs.create_release.outputs.version }}
matrix:
"[{'name':'manylinux 2014 x86_64','runner':'ubuntu-latest','docker_tag':'manylinux2014_x86_64'},
{'name':'manylinux 2014 aarch64','runner':'linux-arm64','docker_tag':'manylinux2014_aarch64'}]"
release: true
secrets: inherit
build_on_debian_static:
needs: create_release
uses: ./.github/workflows/reusable-build-on-debian-static.yml
with:
version: ${{ needs.create_release.outputs.version }}
release: true
secrets: inherit
build_on_alpine_static:
needs: create_release
uses: ./.github/workflows/reusable-build-on-alpine-static.yml
with:
version: ${{ needs.create_release.outputs.version }}
release: true
secrets: inherit
build_on_windows:
needs: create_release
uses: ./.github/workflows/reusable-build-on-windows.yml
with:
version: ${{ needs.create_release.outputs.version }}
release: true
secrets: inherit
build_on_windows_msvc:
needs: create_release
uses: ./.github/workflows/reusable-build-on-windows-msvc.yml
with:
version: ${{ needs.create_release.outputs.version }}
release: true
secrets: inherit
build_on_android:
needs: create_release
uses: ./.github/workflows/reusable-build-on-android.yml
with:
version: ${{ needs.create_release.outputs.version }}
release: true
secrets: inherit
build_and_upload_wasinn_ubuntu:
name: Build and upload WASI-NN on Ubuntu 20.04
runs-on: ubuntu-latest
env:
output_dir: build/plugins/wasi_nn
build_options: -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=PyTorch -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=OpenVINO -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=TensorFlowLite -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=GGML
tar_names: wasi_nn-pytorch wasi_nn-openvino wasi_nn-tensorflowlite wasi_nn-ggml
output_bin: libwasmedgePluginWasiNN.so
OPENVINO_VERSION: "2023.0.2"
OPENVINO_YEAR: "2023"
PYTORCH_VERSION: "1.8.2"
PYTORCH_INSTALL_TO: "."
needs: create_release
container:
image: wasmedge/wasmedge:ubuntu-20.04-build-clang
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: Install dependencies
shell: bash
run: |
apt update
apt install -y unzip libopenblas-dev pkg-config
bash utils/wasi-nn/install-openvino.sh
bash utils/wasi-nn/install-pytorch.sh
- name: Build WASI-NN plugin
shell: bash
run: |
export Torch_DIR=$(pwd)/${PYTORCH_INSTALL_TO}/libtorch
ldconfig
plugin_array=(${tar_names})
option_array=(${build_options})
outtarget=${output_bin%.*}
outtarget=${outtarget#lib}
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Building ${plugin_array[$i]} backend:"
cmake -Bbuild -GNinja ${option_array[$i]}
cmake --build build --target ${outtarget}
echo "Copying ${plugin_array[$i]} backend:"
cp -f ${output_dir}/${output_bin} ${output_bin}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${output_bin}
done
- name: Install gh
run: |
type -p curl >/dev/null || (apt update && apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y
- name: Upload wasi_nn-pytorch plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_nn-pytorch.tar.gz WasmEdge-plugin-wasi_nn-pytorch-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_nn-pytorch-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasi_nn-openvino plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_nn-openvino.tar.gz WasmEdge-plugin-wasi_nn-openvino-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_nn-openvino-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasi_nn-tensorflowlite plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_nn-tensorflowlite.tar.gz WasmEdge-plugin-wasi_nn-tensorflowlite-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_nn-tensorflowlite-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasi_nn-ggml plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_nn-ggml.tar.gz WasmEdge-plugin-wasi_nn-ggml-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_nn-ggml-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
build_and_upload_plugin_ubuntu:
name: Build and upload plugins on Ubuntu 20.04
runs-on: ubuntu-latest
env:
output_prefix: build/plugins
build_options: -DWASMEDGE_PLUGIN_WASI_CRYPTO=ON -DWASMEDGE_PLUGIN_WASI_LOGGING=ON -DWASMEDGE_PLUGIN_RUSTLS=ON -DWASMEDGE_PLUGIN_PROCESS=ON -DWASMEDGE_PLUGIN_TENSORFLOW=ON -DWASMEDGE_PLUGIN_TENSORFLOWLITE=ON -DWASMEDGE_PLUGIN_IMAGE=ON -DWASMEDGE_PLUGIN_WASM_BPF=ON -DWASMEDGE_PLUGIN_OPENCVMINI=ON -DWASMEDGE_PLUGIN_ZLIB=ON
tar_names: wasi_crypto wasi_logging wasmedge_rustls wasmedge_process wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image wasm_bpf wasmedge_opencvmini wasmedge_zlib
output_bins: libwasmedgePluginWasiCrypto.so libwasmedgePluginWasiLogging.so libwasmedge_rustls.so libwasmedgePluginWasmEdgeProcess.so libwasmedgePluginWasmEdgeTensorflow.so libwasmedgePluginWasmEdgeTensorflowLite.so libwasmedgePluginWasmEdgeImage.so libwasmedgePluginWasmBpf.so libwasmedgePluginWasmEdgeOpenCVMini.so libwasmedgePluginWasmEdgeZlib.so
needs: create_release
container:
image: wasmedge/wasmedge:ubuntu-build-clang-plugins-deps
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: Install dependencies
run: |
apt update
apt install -y libssl-dev cmake g++ wget unzip
apt install -y libelf-dev zlib1g-dev pkg-config
apt install -y cargo
- name: Build plugins
shell: bash
run: |
outbin_array=(${output_bins})
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF ${build_options}
for (( i=0; i<${#outbin_array[@]}; i++ ));
do
echo "Building ${outbin_array[$i]} :"
outtarget=${outbin_array[$i]}
outtarget=${outtarget%.*}
outtarget=${outtarget#lib}
cmake --build build --target ${outtarget}
done
- name: Prepare the plugins tar.gz package
shell: bash
run: |
plugin_array=(${tar_names})
outbin_array=(${output_bins})
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Copying ${plugin_array[$i]} :"
cp ${output_prefix}/${plugin_array[$i]}/${outbin_array[$i]} ${outbin_array[$i]}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${outbin_array[$i]}
done
- name: Install gh
run: |
type -p curl >/dev/null || (apt update && apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y
- name: Upload wasi_crypto plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_crypto.tar.gz WasmEdge-plugin-wasi_crypto-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_crypto-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasi_logging plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_logging.tar.gz WasmEdge-plugin-wasi_logging-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_logging-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasmedge_rustls plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_rustls.tar.gz WasmEdge-plugin-wasmedge_rustls-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_rustls-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasmedge_process plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_process.tar.gz WasmEdge-plugin-wasmedge_process-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_process-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasmedge_tensorflow plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_tensorflow.tar.gz WasmEdge-plugin-wasmedge_tensorflow-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_tensorflow-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasmedge_tensorflowlite plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_tensorflowlite.tar.gz WasmEdge-plugin-wasmedge_tensorflowlite-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_tensorflowlite-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasmedge_image plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_image.tar.gz WasmEdge-plugin-wasmedge_image-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_image-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasm_bpf plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasm_bpf.tar.gz WasmEdge-plugin-wasm_bpf-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasm_bpf-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasmedge_opencvmini plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_opencvmini.tar.gz WasmEdge-plugin-wasmedge_opencvmini-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_opencvmini-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
- name: Upload wasmedge_zlib plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_zlib.tar.gz WasmEdge-plugin-wasmedge_zlib-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_zlib-${{ needs.create_release.outputs.version }}-ubuntu20.04_x86_64.tar.gz --clobber
build_and_upload_wasinn_manylinux:
strategy:
matrix:
include:
- name: Plugins_x86_64
host_runner: ubuntu-latest
docker_tag: manylinux2014_x86_64
- name: Plugins_aarch64
host_runner: linux-arm64
docker_tag: manylinux2014_aarch64
name: Build and upload WASI-NN on ${{ matrix.docker_tag }}
needs: create_release
runs-on: ${{ matrix.host_runner }}
env:
output_dir: build/plugins/wasi_nn
build_options_all_platforms: -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=TensorFlowLite -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=GGML
build_options_manylinux2014_x86_64: -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=PyTorch
build_options_manylinux2014_aarch64:
tar_names_all_platforms: wasi_nn-tensorflowlite wasi_nn-ggml
tar_names_manylinux2014_x86_64: wasi_nn-pytorch
tar_names_manylinux2014_aarch64:
output_bin: libwasmedgePluginWasiNN.so
PYTORCH_VERSION: "1.8.2"
PYTORCH_INSTALL_TO: "."
container:
image: wasmedge/wasmedge:${{ matrix.docker_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: Install dependencies
shell: bash
run: |
mkdir -p build
bash ./utils/wasi-nn/install-pytorch.sh --disable-cxx11-abi
- name: Build WASI-NN plugin
shell: bash
run: |
export Torch_DIR=$(pwd)/${PYTORCH_INSTALL_TO}/libtorch
plugin_array=(${tar_names_all_platforms} ${tar_names_${{ matrix.docker_tag }}})
option_array=(${build_options_all_platforms} ${build_options_${{ matrix.docker_tag }}})
testbin_array=(${test_bins_all_platforms} ${test_bins_${{ matrix.docker_tag }}})
outtarget=${output_bin%.*}
outtarget=${outtarget#lib}
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF -DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=OFF
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Building ${plugin_array[$i]} backend:"
cmake -Bbuild -GNinja ${option_array[$i]} -DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=OFF
cmake --build build --target ${outtarget}
echo "Copying ${plugin_array[$i]} backend:"
cp -f ${output_dir}/${output_bin} ${output_bin}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${output_bin}
done
- name: Install gh on manylinux
run: |
type -p yum-config-manager >/dev/null || sudo yum install yum-utils
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
yum install -y gh
- name: Upload WasmEdge wasi_nn-pytorch plugin tar.gz package
if: contains(matrix.docker_tag, 'manylinux2014_x86_64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_nn-pytorch.tar.gz WasmEdge-plugin-wasi_nn-pytorch-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_nn-pytorch-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload WasmEdge wasi_nn-tensorflowlite plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_nn-tensorflowlite.tar.gz WasmEdge-plugin-wasi_nn-tensorflowlite-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_nn-tensorflowlite-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload WasmEdge wasi_nn-ggml plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_nn-ggml.tar.gz WasmEdge-plugin-wasi_nn-ggml-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_nn-ggml-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
build_and_upload_plugin_manylinux:
strategy:
matrix:
include:
- name: Plugins_x86_64
host_runner: ubuntu-latest
docker_tag: manylinux2014_x86_64-plugins-deps
- name: Plugins_aarch64
host_runner: linux-arm64
docker_tag: manylinux2014_aarch64-plugins-deps
name: Build and upload plugins on ${{ matrix.docker_tag }}
runs-on: ${{ matrix.host_runner }}
env:
output_prefix: build/plugins
build_options_all_platforms: -DWASMEDGE_PLUGIN_WASI_CRYPTO=ON -DWASMEDGE_PLUGIN_WASI_LOGGING=ON -DWASMEDGE_PLUGIN_PROCESS=ON -DWASMEDGE_PLUGIN_TENSORFLOW=ON -DWASMEDGE_PLUGIN_TENSORFLOWLITE=ON -DWASMEDGE_PLUGIN_IMAGE=ON -DWASMEDGE_PLUGIN_OPENCVMINI=ON -DWASMEDGE_PLUGIN_ZLIB=ON
build_options_manylinux2014_x86_64: -DWASMEDGE_PLUGIN_WASM_BPF=ON -DWASMEDGE_PLUGIN_RUSTLS=ON -DWASMEDGE_PLUGIN_WASM_BPF_BUILD_LIBBPF_WITH_PKG_CONF=OFF
build_options_manylinux2014_aarch64:
tar_names_all_platforms: wasi_crypto wasi_logging wasmedge_process wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image wasmedge_opencvmini wasmedge_zlib
tar_names_manylinux2014_x86_64: wasm_bpf wasmedge_rustls
tar_names_manylinux2014_aarch64:
output_bins_all_platforms: libwasmedgePluginWasiCrypto.so libwasmedgePluginWasiLogging.so libwasmedgePluginWasmEdgeProcess.so libwasmedgePluginWasmEdgeTensorflow.so libwasmedgePluginWasmEdgeTensorflowLite.so libwasmedgePluginWasmEdgeImage.so libwasmedgePluginWasmEdgeOpenCVMini.so libwasmedgePluginWasmEdgeZlib.so
output_bins_manylinux2014_x86_64: libwasmedgePluginWasmBpf.so libwasmedge_rustls.so
output_bins_manylinux2014_aarch64:
needs: create_release
container:
image: wasmedge/wasmedge:${{ matrix.docker_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: Build and install dependencies
run: |
yum update -y
yum install -y zlib-devel zlib-static cmake curl wget unzip
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
source "$HOME/.cargo/env"
bash ./utils/wasi-crypto/build-openssl.sh
- name: Build plugins
shell: bash
run: |
source "$HOME/.cargo/env"
outbin_array=(${output_bins_all_platforms} ${output_bins_${{ matrix.docker_tag }}})
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF ${build_options_all_platforms} ${build_options_${{ matrix.docker_tag }}} -DOPENSSL_ROOT_DIR=$(pwd)/openssl-1.1.1n/openssl
for (( i=0; i<${#outbin_array[@]}; i++ ));
do
echo "Building ${outbin_array[$i]} :"
outtarget=${outbin_array[$i]}
outtarget=${outtarget%.*}
outtarget=${outtarget#lib}
cmake --build build --target ${outtarget}
done
- name: Prepare the plugins tar.gz package
shell: bash
run: |
plugin_array=(${tar_names_all_platforms} ${tar_names_${{ matrix.docker_tag }}})
outbin_array=(${output_bins_all_platforms} ${output_bins_${{ matrix.docker_tag }}})
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Copying ${plugin_array[$i]} :"
cp ${output_prefix}/${plugin_array[$i]}/${outbin_array[$i]} ${outbin_array[$i]}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${outbin_array[$i]}
done
- name: Install gh on manylinux
run: |
type -p yum-config-manager >/dev/null || sudo yum install yum-utils
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
yum install -y gh
- name: Upload wasi_crypto plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_crypto.tar.gz WasmEdge-plugin-wasi_crypto-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_crypto-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload wasi_logging plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasi_logging.tar.gz WasmEdge-plugin-wasi_logging-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_logging-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload wasmedge_rustls plugin tar.gz package
if: contains(matrix.docker_tag, 'manylinux2014_x86_64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_rustls.tar.gz WasmEdge-plugin-wasmedge_rustls-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_rustls-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload wasmedge_process plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_process.tar.gz WasmEdge-plugin-wasmedge_process-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_process-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload wasmedge_tensorflow plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_tensorflow.tar.gz WasmEdge-plugin-wasmedge_tensorflow-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_tensorflow-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload wasmedge_tensorflowlite plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_tensorflowlite.tar.gz WasmEdge-plugin-wasmedge_tensorflowlite-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_tensorflowlite-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload wasmedge_image plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_image.tar.gz WasmEdge-plugin-wasmedge_image-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_image-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload wasm_bpf plugin tar.gz package
if: contains(matrix.docker_tag, 'manylinux2014_x86_64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasm_bpf.tar.gz WasmEdge-plugin-wasm_bpf-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasm_bpf-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload wasmedge_opencvmini plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_opencvmini.tar.gz WasmEdge-plugin-wasmedge_opencvmini-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_opencvmini-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload wasmedge_zlib plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv plugin_wasmedge_zlib.tar.gz WasmEdge-plugin-wasmedge_zlib-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_zlib-${{ needs.create_release.outputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
build_and_upload_plugin_macos:
strategy:
matrix:
include:
- name: Plugins_MacOS_12
system: MacOS 12
host_runner: macos-12
darwin_version: darwin_21
arch: x86_64
- name: Plugins_MacOS_arm64
system: MacOS 13 (arm64)
host_runner: mac-arm64
darwin_version: darwin_22
arch: arm64
name: Build and upload plugins on ${{ matrix.system }}
runs-on: ${{ matrix.host_runner }}
env:
output_prefix: build/plugins
build_options: -DWASMEDGE_PLUGIN_WASI_CRYPTO=ON -DWASMEDGE_PLUGIN_WASI_LOGGING=ON -DWASMEDGE_PLUGIN_RUSTLS=ON -DWASMEDGE_PLUGIN_TENSORFLOW=ON -DWASMEDGE_PLUGIN_TENSORFLOWLITE=ON -DWASMEDGE_PLUGIN_IMAGE=ON -DWASMEDGE_PLUGIN_OPENCVMINI=ON -DWASMEDGE_PLUGIN_ZLIB=ON
tar_names: wasi_crypto wasi_logging wasmedge_rustls wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image wasmedge_opencvmini wasmedge_zlib
output_bins: libwasmedgePluginWasiCrypto.dylib libwasmedgePluginWasiLogging.dylib libwasmedge_rustls.dylib libwasmedgePluginWasmEdgeTensorflow.dylib libwasmedgePluginWasmEdgeTensorflowLite.dylib libwasmedgePluginWasmEdgeImage.dylib libwasmedgePluginWasmEdgeOpenCVMini.dylib libwasmedgePluginWasmEdgeZlib.dylib
needs: create_release
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: Install dependencies
run: |
eval $(/opt/homebrew/bin/brew shellenv)
brew install llvm@16 ninja cmake openssl wabt opencv rust gh
- name: Build plugins
shell: bash
run: |
eval $(/opt/homebrew/bin/brew shellenv)
outbin_array=(${output_bins})
export LLVM_DIR="$(brew --prefix)/opt/llvm@16/lib/cmake"
export CC=clang
export CXX=clang++
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl ${build_options}
for (( i=0; i<${#outbin_array[@]}; i++ ));
do
echo "Building ${outbin_array[$i]} :"
outtarget=${outbin_array[$i]}
outtarget=${outtarget%.*}
outtarget=${outtarget#lib}
cmake --build build --target ${outtarget}
done
- name: Prepare the WasmEdge plugins tar.gz package
shell: bash
run: |
plugin_array=(${tar_names})
outbin_array=(${output_bins})
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Copying ${plugin_array[$i]} :"
cp ${output_prefix}/${plugin_array[$i]}/${outbin_array[$i]} ${outbin_array[$i]}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${outbin_array[$i]}
done
- name: Upload wasi_crypto plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
eval $(/opt/homebrew/bin/brew shellenv)
mv plugin_wasi_crypto.tar.gz WasmEdge-plugin-wasi_crypto-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_crypto-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz --clobber
- name: Upload wasi_logging plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
eval $(/opt/homebrew/bin/brew shellenv)
mv plugin_wasi_logging.tar.gz WasmEdge-plugin-wasi_logging-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasi_logging-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz --clobber
- name: Upload wasmedge_rustls plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
eval $(/opt/homebrew/bin/brew shellenv)
mv plugin_wasmedge_rustls.tar.gz WasmEdge-plugin-wasmedge_rustls-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_rustls-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz --clobber
- name: Upload wasmedge_tensorflow plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
eval $(/opt/homebrew/bin/brew shellenv)
mv plugin_wasmedge_tensorflow.tar.gz WasmEdge-plugin-wasmedge_tensorflow-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_tensorflow-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz --clobber
- name: Upload wasmedge_tensorflowlite plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
eval $(/opt/homebrew/bin/brew shellenv)
mv plugin_wasmedge_tensorflowlite.tar.gz WasmEdge-plugin-wasmedge_tensorflowlite-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_tensorflowlite-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz --clobber
- name: Upload wasmedge_image plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
eval $(/opt/homebrew/bin/brew shellenv)
mv plugin_wasmedge_image.tar.gz WasmEdge-plugin-wasmedge_image-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_image-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz --clobber
- name: Upload wasmedge_opencvmini plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
eval $(/opt/homebrew/bin/brew shellenv)
mv plugin_wasmedge_opencvmini.tar.gz WasmEdge-plugin-wasmedge_opencvmini-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_opencvmini-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz --clobber
- name: Upload wasmedge_zlib plugin tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
eval $(/opt/homebrew/bin/brew shellenv)
mv plugin_wasmedge_zlib.tar.gz WasmEdge-plugin-wasmedge_zlib-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-plugin-wasmedge_zlib-${{ needs.create_release.outputs.version }}-darwin_${{ matrix.arch }}.tar.gz --clobber
build_manylinux2014_runtime_only:
name: Build runtime only on manylinux2014 platform
needs: create_release
runs-on: ubuntu-latest
container:
image: wasmedge/wasmedge:manylinux2014_x86_64
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: Build runtime only manylinux2014 package
run: |
bash utils/docker/build-manylinux.sh -DWASMEDGE_BUILD_AOT_RUNTIME=OFF
- name: Upload ${{ matrix.name }} tar.gz package to artifact
uses: actions/upload-artifact@v3
with:
name: build_manylinux2014_runtime_only
path: build/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.tar.gz
- name: Install gh on manylinux
run: |
type -p yum-config-manager >/dev/null || sudo yum install yum-utils
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
yum install -y gh
- name: Upload ${{ matrix.name }} tar.gz package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv build/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.tar.xz WasmEdge-runtime-only-${{ needs.create_release.outputs.version }}-manylinux2014_x86_64.tar.xz
gh release upload ${{ needs.create_release.outputs.version }} WasmEdge-runtime-only-${{ needs.create_release.outputs.version }}-manylinux2014_x86_64.tar.xz --clobber
build_docker_slim_images:
strategy:
matrix:
include:
- name: wasmedge/slim:${{ needs.create_release.outputs.version }}
artifact_name: WasmEdge-${{ needs.create_release.outputs.version }}-manylinux2014_x86_64.tar.gz
include_bin: "--include-bin /usr/local/bin/wasmedge --include-bin /usr/local/bin/wasmedgec"
- name: wasmedge/slim-runtime:${{ needs.create_release.outputs.version }}
artifact_name: build_manylinux2014_runtime_only
include_bin: "--include-bin /usr/local/bin/wasmedge"
name: Build DockerSlim Images
needs:
[create_release, build_on_manylinux2014, build_manylinux2014_runtime_only]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Prepare tarball
uses: actions/download-artifact@v3
with:
name: ${{ matrix.artifact_name }}
path: utils/docker
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: Install requirements
run: |
curl -sL https://raw.githubusercontent.com/slimtoolkit/slim/master/scripts/install-slim.sh | sudo -E bash -
- name: Prepare docker env
id: docker_env
run: |
echo "docker_image=${{ matrix.name }}" >> $GITHUB_OUTPUT
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Run slim
run: |
slim build \
--dockerfile Dockerfile.release \
--dockerfile-context utils/docker \
--tag ${{ steps.docker_env.outputs.docker_image }} \
--http-probe-off \
--include-bin /usr/lib/x86_64-linux-gnu/libnss_compat.so.2 \
--include-bin /usr/lib/x86_64-linux-gnu/libnss_dns.so.2 \
--include-bin /usr/lib/x86_64-linux-gnu/libnss_files.so.2 \
--include-bin /usr/lib/x86_64-linux-gnu/libresolv.so.2 \
--include-path /etc/services \
${{ matrix.include_bin }} \
--cbo-build-arg VERSION="${{ needs.create_release.outputs.version }}" \
--cbo-label org.opencontainers.image.title="${{ github.event.repository.name }}" \
--cbo-label org.opencontainers.image.description="${{ github.event.repository.description }}" \
--cbo-label org.opencontainers.image.url="${{ github.event.repository.html_url }}" \
--cbo-label org.opencontainers.image.source="${{ github.event.repository.clone_url }}" \
--cbo-label org.opencontainers.image.version="${{ needs.create_release.outputs.version }}" \
--cbo-label org.opencontainers.image.created="${{ steps.docker_env.outputs.created }}" \
--cbo-label org.opencontainers.image.revision="${{ github.sha }}" \
--cbo-label org.opencontainers.image.licenses="${{ github.event.repository.license.spdx_id }}"
- name: Push to DockerHub
run: |
docker push ${{ steps.docker_env.outputs.docker_image }}
generate_sbom:
runs-on: ubuntu-latest
needs: create_release
steps:
- name: checkout code
uses: actions/checkout@v3
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: generate sbom
uses: advanced-security/sbom-generator-action@v0.0.1
id: sbom
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: install gh
run: |
type -p curl >/dev/null || (apt update && apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y
- name: Generate tar.gz file and upload release
shell: bash
run: |
tar -zcvf sbom.tar.gz ${{steps.sbom.outputs.fileName}}
gh release upload ${{needs.create_release.outputs.version}} sbom.tar.gz --clobber