-
Notifications
You must be signed in to change notification settings - Fork 819
873 lines (865 loc) · 35.6 KB
/
build.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
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
name: Builds
env:
RUST_BACKTRACE: 1
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git
MSRV: "1.81"
on:
push:
branches:
- 'main'
tags:
# this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- '[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
inputs:
release:
description: 'Make release'
jobs:
setup:
name: Set up
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.setup.outputs.VERSION }}
DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }}
steps:
- name: Set up env vars
id: setup
shell: bash
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true)
echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT
echo $VERSION
echo $DOING_RELEASE
build:
name: Build on ${{ matrix.build }}
runs-on: ${{ matrix.os }}
needs: setup
strategy:
fail-fast: false
matrix:
include:
- build: linux-arm64
os: arm64-ubuntu-latest-8-cores
artifact_name: 'wasmer-linux-aarch64'
cross_compilation_artifact_name: 'cross_compiled_from_linux'
use_sccache: false
use_llvm: true
build_wasm: true
- build: linux-x64
os: ubuntu-22.04
artifact_name: 'wasmer-linux-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_linux'
use_sccache: false
use_llvm: true
build_wasm: true
- build: linux-x64-v8
os: ubuntu-22.04
artifact_name: 'wasmer-v8-linux-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_linux'
use_sccache: false
use_llvm: true
build_wasm: true
- build: linux-x64-wamr
os: ubuntu-22.04
artifact_name: 'wasmer-wamr-linux-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_linux'
use_sccache: false
use_llvm: true
build_wasm: true
- build: linux-x64-wasmi
os: ubuntu-22.04
artifact_name: 'wasmer-wasmi-linux-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_linux'
use_sccache: false
use_llvm: true
build_wasm: true
- build: macos-x64
os: macos-13
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz'
artifact_name: 'wasmer-darwin-amd64'
cross_compilation_artifact_name: 'cross_compiled_from_mac'
use_sccache: false
use_llvm: true
build_wasm: false
- build: macos-x64-v8
os: macos-13
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz'
artifact_name: 'wasmer-v8-darwin-amd64'
cross_compilation_artifact_name: 'cross_compiled_from_mac'
use_sccache: false
use_llvm: true
build_wasm: false
- build: macos-x64-wamr
os: macos-13
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz'
artifact_name: 'wasmer-wamr-darwin-amd64'
cross_compilation_artifact_name: 'cross_compiled_from_mac'
use_sccache: false
use_llvm: true
build_wasm: false
- build: macos-x64-wasmi
os: macos-13
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz'
artifact_name: 'wasmer-wasmi-darwin-amd64'
cross_compilation_artifact_name: 'cross_compiled_from_mac'
use_sccache: false
use_llvm: true
build_wasm: false
- build: macos-arm64
os: macos-14
target: aarch64-apple-darwin
artifact_name: 'wasmer-darwin-arm64'
use_sccache: false
use_llvm: true
build_wasm: false
# [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly.
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz'
- build: macos-arm64-v8
os: macos-14
target: aarch64-apple-darwin
artifact_name: 'wasmer-v8-darwin-arm64'
use_sccache: false
use_llvm: false
build_wasm: false
# [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly.
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz'
- build: macos-arm64-wamr
os: macos-14
target: aarch64-apple-darwin
artifact_name: 'wasmer-wamr-darwin-arm64'
use_sccache: false
use_llvm: false
build_wasm: false
# [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly.
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz'
- build: macos-arm64-wasmi
os: macos-14
target: aarch64-apple-darwin
artifact_name: 'wasmer-wasmi-darwin-arm64'
use_sccache: false
use_llvm: false
build_wasm: false
# [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly.
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz'
- build: windows-x64
os: windows-2022
artifact_name: 'wasmer-windows-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_win'
use_sccache: false
use_llvm: true
build_wasm: false
- build: windows-x64-v8
os: windows-2022
artifact_name: 'wasmer-v8-windows-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_win'
use_sccache: false
use_llvm: true
build_wasm: false
- build: windows-x64-wamr
os: windows-2022
artifact_name: 'wasmer-wamr-windows-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_win'
use_sccache: false
use_llvm: true
build_wasm: false
- build: windows-x64-wasmi
os: windows-2022
artifact_name: 'wasmer-wasmi-windows-amd64'
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_win'
use_sccache: false
use_llvm: true
build_wasm: false
- build: linux-musl-x64
os: ubuntu-latest
artifact_name: 'wasmer-linux-musl-amd64'
container: alpine:latest
use_sccache: false
use_llvm: false
build_wasm: true
- build: linux-musl-x64-v8
os: ubuntu-latest
artifact_name: 'wasmer-v8-linux-musl-amd64'
container: alpine:latest
use_sccache: false
use_llvm: false
build_wasm: true
- build: linux-musl-x64-wasmi
os: ubuntu-latest
artifact_name: 'wasmer-wasmi-linux-musl-amd64'
container: alpine:latest
use_sccache: false
use_llvm: false
build_wasm: true
container: ${{ matrix.container }}
env:
SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }}
TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@v3
- name: Set up base deps on musl
if: startsWith(matrix.build, 'linux-musl-x64')
run: |
apk add bash mold make curl cmake ninja clang18 zstd-static llvm18-dev clang18-static llvm18-static ncurses-static zlib-static
ln -s /usr/bin/clang-18 /usr/bin/clang
- name: Install Linux tools
if: startsWith(matrix.build, 'linux-x64')
run: |
sudo apt install mold ninja-build
- name: Install Linux ARM tools
if: startsWith(matrix.build, 'linux-arm64')
run: |
sudo apt install mold ninja-build llvm-18-dev libclang-18-dev clang-18 cmake make libpolly-18-dev libzstd1 zstd libzstd-dev
- name: Install Linux musl tools
if: startsWith(matrix.build, 'linux-musl')
run: |
apk add mold cmake ninja bash curl make llvm18 llvm18-dev clang18 lld clang18-static
- name: Install `ninja` on macOS
if: startsWith(matrix.build, 'macos-')
shell: bash
run: |
brew install ninja gcc
- name: Install `ninja` on Windows
if: startsWith(matrix.build, 'windows-')
shell: bash
run: |
choco install ninja
- name: Delete unwanted link to stop it from interfering (Windows)
if: startsWith(matrix.build, 'windows-')
shell: bash
run: rm /usr/bin/link.exe
- name: Install standard header files on macOS
if: startsWith(matrix.build, 'macos-')
shell: bash
run: |
sudo xcode-select -s /Library/Developer/CommandLineTools
echo "CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include" >> $GITHUB_ENV
- name: Install MSVC dev-cmd (Windows)
uses: ilammy/msvc-dev-cmd@v1
if: startsWith(matrix.build, 'windows-')
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.MSRV }}
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
if: matrix.use_sccache != true
- name: Install LLVM (macOS Apple Silicon)
if: matrix.os == 'macos-12' && !matrix.llvm_url
run: |
brew install llvm
- name: Install LLVM
if: matrix.llvm_url
shell: bash
run: |
LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }}
mkdir -p ${LLVM_DIR}
curl --proto '=https' --tlsv1.2 -sSf "${{ matrix.llvm_url }}" -L -o - | tar xJv -C ${LLVM_DIR}
echo "${LLVM_DIR}/bin" >> $GITHUB_PATH
env:
LLVM_DIR: .llvm
- name: Configure LLVM (Windows)
# The Custom Windows build does not contains llvm-config.exe, so need to setup manualy here
if: startsWith(matrix.build, 'windows-x64') && matrix.llvm_url
shell: bash
run: |
LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }}
echo LLVM_SYS_180_PREFIX="${LLVM_DIR}" >> $GITHUB_ENV
echo LLVM_ENABLE=1 >> $GITHUB_ENV
env:
LLVM_DIR: .llvm
- name: Add `brew` libraries (Apple Silicon)
run: |
echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV
if: matrix.os == 'macos-14'
- name: Set up dependencies for Mac OS
run: |
brew install automake
# using gnu-tar is a workaround for https://github.com/actions/cache/issues/403
brew install gnu-tar
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
if: startsWith(matrix.os, 'macos')
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ matrix.build }}-${{ matrix.target }}-cargo-${{ hashFiles('Cargo.lock') }}-v1
- uses: actions/cache@v2
if: matrix.use_sccache
with:
path: ${{ runner.tool_cache }}/cargo-sccache
key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1
- name: Install sccache
if: matrix.use_sccache
run: |
if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then
cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache'
fi
shell: bash
- name: Setup Rust target
run: |
mkdir -p .cargo
cat << EOF > .cargo/config.toml
[build]
target = "${{ matrix.target }}"
EOF
if: matrix.target
- name: Set sccache port
if: matrix.use_sccache && matrix.random_sccache_port
run: |
netstat -aln | awk '
$6 == "LISTEN" {
if ($4 ~ "[.:][0-9]+$") {
n = split($4, a, /[:.]/);
port = a[n];
p[port] = 1
}
}
END {
for (i = 3000; i < 65000 && p[i]; i++){};
if (i == 65000) {exit 1};
print "SCCACHE_SERVER_PORT=" i
}
' >> $GITHUB_ENV
# echo "SCCACHE_SERVER_PORT=9000"
echo "Setting random sccache port to: $SCCACHE_SERVER_PORT"
shell: bash
- name: Start sccache
if: matrix.use_sccache
run: |
chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache'
'${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server
'${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s
echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV
shell: bash
- name: Build C API headless
shell: bash
run: |
LLVM_CONFIG_PATH=/usr/bin/llvm-config-18 make package-capi-headless
- name: Build C API
shell: bash
run: |
LLVM_CONFIG_PATH=/usr/bin/llvm-config-18 make build-capi
- name: Build Wasmer binary with LLVM
if: matrix.use_llvm && !endsWith(matrix.build, 'v8') && !endsWith(matrix.build, 'wamr') && !endsWith(matrix.build, 'wasmi')
shell: bash
run: |
make build-wasmer
env:
ENABLE_LLVM: 1
- name: Build Wasmer with v8 backend with mold
if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-x64') }}
run: |
RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" make build-wasmer-v8
- name: Build Wasmer with v8 backend musl
if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-musl') }}
run: |
echo "#!/bin/bash" >> /usr/bin/llvm-config
echo 'if [ "$1" = "--libs" ]; then' >> /usr/bin/llvm-config
echo 'llvm-config-18 "$@" "--link-static"' >> /usr/bin/llvm-config
echo "else" >> /usr/bin/llvm-config
echo 'llvm-config-18 "$@"' >> /usr/bin/llvm-config
echo 'fi' >> /usr/bin/llvm-config
cat /usr/bin/llvm-config
chmod +x /usr/bin/llvm-config
LLVM_CONFIG_PATH=/usr/bin/llvm-config RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-v8
- name: Build Wasmer with v8 backend
if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux-x64') && !startsWith(matrix.build, 'linux-musl') }}
run: |
echo $LIBCLANG_STATIC_PATH
make build-wasmer-v8
- name: Build Wasmer with wamr backend
if: ${{ endsWith(matrix.build, 'wamr') && !startsWith(matrix.build, 'linux-musl') }}
run: |
make build-wasmer-wamr
- name: Build Wasmer with wasmi backend
if: endsWith(matrix.build, 'wasmi') && !startsWith(matrix.build, 'linux-musl')
run: |
make build-wasmer-wasmi
- name: Build Wasmer with wasmi backend musl
if: endsWith(matrix.build, 'wasmi') && startsWith(matrix.build, 'linux-musl')
run: |
echo "#!/bin/bash" >> /usr/bin/llvm-config
echo 'if [ "$1" = "--libs" ]; then' >> /usr/bin/llvm-config
echo 'llvm-config-18 "$@" "--link-static"' >> /usr/bin/llvm-config
echo "else" >> /usr/bin/llvm-config
echo 'llvm-config-18 "$@"' >> /usr/bin/llvm-config
echo 'fi' >> /usr/bin/llvm-config
cat /usr/bin/llvm-config
chmod +x /usr/bin/llvm-config
RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-wasmi
- name: Build Wasmer binary without LLVM
if: matrix.use_llvm != true && !endsWith(matrix.build, 'v8') && !endsWith(matrix.build, 'wamr') && !endsWith(matrix.build, 'wasmi')
shell: bash
run: |
make build-wasmer
#- name: Build Wasmer binary on Wasm32-WASI without LLVM
# if: matrix.build_wasm
# shell: bash
# run: |
# make build-wasmer-wasm
- name: Install Nightly Rust for Headless
if: ${{ !startsWith(matrix.build, 'linux-musl-x64') }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2024-07-05"
target: ${{ matrix.target }}
components: "rust-src"
- name: Build Minimal Wasmer Headless
if: ${{ !startsWith(matrix.build, 'linux-musl-x64') }}
run: |
cargo install xargo
echo "" >> Cargo.toml
echo "[profile.release]" >> Cargo.toml
echo "opt-level = 'z'" >> Cargo.toml
echo "debug = false" >> Cargo.toml
echo "debug-assertions = false" >> Cargo.toml
echo "overflow-checks = false" >> Cargo.toml
echo "lto = true" >> Cargo.toml
echo "panic = 'abort'" >> Cargo.toml
echo "incremental = false" >> Cargo.toml
echo "codegen-units = 1" >> Cargo.toml
echo "rpath = false" >> Cargo.toml
rustup override set nightly-2024-07-05
make build-wasmer-headless-minimal
rustup override unset
- name: Dist
run: |
make distribution
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: dist
if-no-files-found: error
retention-days: 2
windows_gnu:
name: Windows GNU
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Windows-GNU linker
shell: bash
run: |
sudo apt install -y mingw-w64
- uses: dtolnay/rust-toolchain@stable
with:
target: x86_64-pc-windows-gnu
- name: Install Windows-GNU target
shell: bash
run: |
rustup target add x86_64-pc-windows-gnu
- name: Install Windows 10 SDK with xwin
shell: bash
run: |
mkdir -p /tmp/xwin
mkdir -p /tmp/xwindownload
mkdir -p /tmp/xwincache
git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin
cargo build --release --manifest-path=/tmp/xwin/Cargo.toml
/tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload
mkdir -p /tmp/winsdk
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/
cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/
echo "WinSDK files:"
ls -laH /tmp/winsdk
echo ""
mkdir -p package
mkdir -p package/winsdk
cp -r /tmp/winsdk/* package/winsdk
- name: Build Wasmer C-API without LLVM
shell: bash
run: |
make build-capi
env:
RUSTFLAGS: -Cpanic=abort
CARGO_TARGET: x86_64-pc-windows-gnu
ENABLE_LLVM: 0
- name: Build Wasmer C-API headless without LLVM
shell: bash
run: |
make build-capi-headless
env:
RUSTFLAGS: -Cpanic=abort
CARGO_TARGET: x86_64-pc-windows-gnu
ENABLE_LLVM: 0
- name: Dist
run: |
make distribution-gnu
env:
CARGO_TARGET: x86_64-pc-windows-gnu
TARGET_DIR: target/x86_64-pc-windows-gnu/release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: 'wasmer-windows-gnu64'
path: dist
if-no-files-found: error
retention-days: 2
darwin_aarch64_jsc:
name: macOS aarch64 (JSC)
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-apple-darwin
- name: Install Darwin-aarch64 target
shell: bash
run: |
rustup target add aarch64-apple-darwin
- name: Build Wasmer C-API (JSC)
shell: bash
run: |
make build-capi-jsc
env:
RUSTFLAGS: -Cpanic=abort
CARGO_TARGET: aarch64-apple-darwin
- name: Dist
run: |
make distribution
env:
CARGO_TARGET: aarch64-apple-darwin
TARGET_DIR: target/aarch64-apple-darwin/release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: 'aarch64-apple-darwin-jsc'
path: dist
if-no-files-found: error
retention-days: 2
darwin_x86_64_jsc:
name: macOS x86_64 (JSC)
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: x86_64-apple-darwin
- name: Build Wasmer C-API (JSC)
shell: bash
run: |
make build-capi-jsc
env:
RUSTFLAGS: -Cpanic=abort
CARGO_TARGET: x86_64-apple-darwin
- name: Dist
run: |
make distribution
env:
CARGO_TARGET: x86_64-apple-darwin
TARGET_DIR: target/x86_64-apple-darwin/release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: 'x86_64-apple-darwin-jsc'
path: dist
if-no-files-found: error
retention-days: 2
linux_riscv64:
name: Linux riscv64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: riscv64gc-unknown-linux-gnu
- name: Build cross image
run: |
docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/
env:
CROSS_DOCKER_IN_DOCKER: true
- name: Build Wasmer binary
run: |
make build-wasmer
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: riscv64gc-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
- name: Build C API headless
shell: bash
run: |
make package-capi-headless
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: riscv64gc-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
TARGET: riscv64gc-unknown-linux-gnu
TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release
- name: Build C API
run: |
make build-capi
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: riscv64gc-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
- name: Dist
run: |
make distribution
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: riscv64gc-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
TARGET: riscv64gc-unknown-linux-gnu
TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: wasmer-linux-riscv64
path: dist
if-no-files-found: error
retention-days: 2
release:
needs: [setup, build, windows_gnu, linux_riscv64]
runs-on: ubuntu-latest
if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != ''
steps:
- name: Download the Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.setup.outputs.VERSION }}
release_name: Release ${{ needs.setup.outputs.VERSION }}
draft: true
prerelease: false
- name: Upload Release Asset Windows Installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-windows-amd64/WasmerInstaller.exe
asset_name: wasmer-windows.exe
asset_content_type: application/vnd.microsoft.portable-executable
- name: Upload Release Asset Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-windows-amd64/wasmer.tar.gz
asset_name: wasmer-windows-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Windows With v8
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-v8-windows-amd64/wasmer.tar.gz
asset_name: wasmer-v8-windows-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Windows With wamr
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wamr-windows-amd64/wasmer.tar.gz
asset_name: wasmer-wamr-windows-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Windows With wasmi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wasmi-windows-amd64/wasmer.tar.gz
asset_name: wasmer-wasmi-windows-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-linux-amd64/wasmer.tar.gz
asset_name: wasmer-linux-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64 With v8
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-v8-linux-amd64/wasmer.tar.gz
asset_name: wasmer-v8-linux-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64 With wamr
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wamr-linux-amd64/wasmer.tar.gz
asset_name: wasmer-wamr-linux-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64 with wasmi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wasmi-linux-amd64/wasmer.tar.gz
asset_name: wasmer-wasmi-linux-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux aarch64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz
asset_name: wasmer-linux-aarch64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux riscv64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-linux-riscv64/wasmer.tar.gz
asset_name: wasmer-linux-riscv64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Windows gnu64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-windows-gnu64/wasmer.tar.gz
asset_name: wasmer-windows-gnu64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64 (musl)
id: upload-release-asset-linux-musl-amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-linux-musl-amd64/wasmer.tar.gz
asset_name: wasmer-linux-musl-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64 (musl) With v8
id: upload-release-asset-linux-musl-amd64-v8
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-v8-linux-musl-amd64/wasmer.tar.gz
asset_name: wasmer-v8-linux-musl-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64 (musl) With wasmi
id: upload-release-asset-linux-musl-amd64-wasmi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wasmi-linux-musl-amd64/wasmer.tar.gz
asset_name: wasmer-wasmi-linux-musl-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-darwin-amd64/wasmer.tar.gz
asset_name: wasmer-darwin-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac amd64 With v8
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-v8-darwin-amd64/wasmer.tar.gz
asset_name: wasmer-v8-darwin-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac amd64 With wamr
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wamr-darwin-amd64/wasmer.tar.gz
asset_name: wasmer-wamr-darwin-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac amd64 With wasmi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wasmi-darwin-amd64/wasmer.tar.gz
asset_name: wasmer-wasmi-darwin-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-darwin-arm64/wasmer.tar.gz
asset_name: wasmer-darwin-arm64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac arm64 With v8
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-v8-darwin-arm64/wasmer.tar.gz
asset_name: wasmer-v8-darwin-arm64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac arm64 With wamr
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wamr-darwin-arm64/wasmer.tar.gz
asset_name: wasmer-wamr-darwin-arm64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac arm64 With wasmi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wasmi-darwin-arm64/wasmer.tar.gz
asset_name: wasmer-wasmi-darwin-arm64.tar.gz
asset_content_type: application/gzip