-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (145 loc) · 4.96 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
name: build
on:
push:
tags:
- "*"
pull_request:
workflow_dispatch:
jobs:
linux:
name: ${{ matrix.arch }}-linux
runs-on:
- ${{ matrix.runner_tag }}
- Linux
- podman
strategy:
matrix:
include:
- arch: x86_64
runner_tag: X64
- arch: aarch64
runner_tag: ARM64
steps:
- name: checkout
uses: actions/checkout@v4
- name: build-image
run: |
podman rmi --ignore rust:alpine-mimalloc
pushd "$(mktemp -d)"
curl -f -L --retry 5 https://github.com/tweag/rust-alpine-mimalloc/archive/refs/heads/master.tar.gz | tar xz --strip-components=1
podman build \
--network host \
--pull \
--squash-all \
--tag rust:alpine-mimalloc \
.
popd
- name: build
run: |
podman run \
--init \
--network host \
--rm \
--tmpfs /tmp:exec \
--volume $PWD:/workspace \
--workdir /workspace \
rust:alpine-mimalloc \
sh -c 'TARGET=$(rustc -vV | sed -n "s|host: ||p") && exec ./build.sh --target $TARGET'
MIMALLOC_VERBOSE=1 ./bin/wasm-component-ld --help
MIMALLOC_VERBOSE=1 ./bin/wasm-tools --version
MIMALLOC_VERBOSE=1 ./bin/wasmtime --version
MIMALLOC_VERBOSE=1 ./bin/wit-bindgen --version
MIMALLOC_VERBOSE=1 ./bin/wizer --version
file ./bin/wasm-component-ld
file ./bin/wasm-tools
file ./bin/wasmtime
file ./bin/wit-bindgen
file ./bin/wizer
mkdir wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
mv bin wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
tar \
--sort=name \
--owner=0 --group=0 --numeric-owner \
--use-compress-program="zstd --ultra -22 --threads=0" \
-cf wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux.tar.zst \
wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
path: wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux.tar.zst
darwin:
name: darwin-${{ matrix.arch }}
runs-on:
- ARM64
- macOS
strategy:
matrix:
arch:
- x86_64
- aarch64
steps:
- name: checkout
uses: actions/checkout@v4
- name: install-deps
run: |
rustup update
rustup target add ${{ matrix.arch }}-apple-darwin
- name: build
run: |
./build.sh --target ${{ matrix.arch }}-apple-darwin
file ./bin/wasm-component-ld
file ./bin/wasm-tools
file ./bin/wasmtime
file ./bin/wit-bindgen
file ./bin/wizer
mkdir wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
mv bin wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
tar \
--use-compress-program="zstd --ultra -22 --threads=0" \
-cf wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}.tar.zst \
wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
path: wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}.tar.zst
windows:
name: windows-${{ matrix.arch }}
runs-on:
- X64
- Windows
strategy:
matrix:
arch:
- x86_64
steps:
- name: checkout
uses: actions/checkout@v4
- name: install-deps
run: |
rustup update
rustup target add ${{ matrix.arch }}-pc-windows-msvc
- name: build
run: |
mkdir wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }}
cargo install `
--all-features `
--root wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }} `
--target ${{ matrix.arch }}-pc-windows-msvc `
--git https://github.com/haskell-wasm/wizer.git `
wizer
cargo install `
--root wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }} `
--target ${{ matrix.arch }}-pc-windows-msvc `
wasm-tools
cargo install `
--all-features `
--root wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }} `
--target ${{ matrix.arch }}-pc-windows-msvc `
wasmtime-cli wasm-component-ld wit-bindgen-cli
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }}
path: wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }}