forked from WasmEdge/WasmEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
365 lines (355 loc) · 15.1 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
name: release
concurrency:
group: release-${{ github.head_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
container:
image: wasmedge/wasmedge:ubuntu-build-gcc
outputs:
version: ${{ steps.prep.outputs.version }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get version
id: prep
run: |
# Retrieve annotated tags. Details: https://github.com/actions/checkout/issues/290
git config --global --add safe.directory $(pwd)
git fetch --tags --force
echo ::set-output name=version::$(git describe --match "[0-9].[0-9]*" --tag)
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: WasmEdge ${{ steps.prep.outputs.version }}
body_path: .CurrentChangelog.md
draft: true
prerelease: true
create_source_tarball:
name: Create source tarball
runs-on: ubuntu-latest
needs: create_release
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Propagate version information for tarball
run: |
echo $VERSION | tee VERSION
env:
VERSION: ${{ needs.create_release.outputs.version }}
- name: Create source tarball
run: |
TEMPDIR=$(mktemp -d)
SRCDIR="$TEMPDIR/wasmedge/"
mkdir -p "$SRCDIR"
git checkout-index -a --prefix="$SRCDIR"
cp -v VERSION $SRCDIR
tar --owner 0 --group 0 -czf "$GITHUB_WORKSPACE/WasmEdge-$VERSION.tar.gz" -C "$TEMPDIR" "wasmedge"
env:
VERSION: ${{ needs.create_release.outputs.version }}
- name: Upload source tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-src.tar.gz
asset_path: WasmEdge-${{ needs.create_release.outputs.version }}.tar.gz
asset_content_type: application/x-gzip
build_on_macos:
strategy:
fail-fast: false
matrix:
include:
- name: macos x86_64
os: darwin
name: Build and upload WasmEdge on ${{ matrix.name }} platform
needs: create_release
runs-on: macos-10.15
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build package
run: |
brew install llvm ninja boost cmake
export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export CC=clang
export CXX=clang++
rm -rf build
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_PACKAGE="TGZ" .
cmake --build build
cmake --build build --target package
- name: Upload tar.gz package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/WasmEdge-${{ needs.create_release.outputs.version }}-Darwin.tar.gz
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.os }}_x86_64.tar.gz
asset_content_type: application/x-gzip
build_on_manylinux_legacy:
strategy:
fail-fast: false
matrix:
include:
- name: manylinux1_x86_64
docker_tag: manylinux1_x86_64
- name: manylinux2010_x86_64
docker_tag: manylinux2010_x86_64
name: Build on ${{ matrix.name }} platform
needs: create_release
runs-on: ubuntu-latest
container:
image: wasmedge/wasmedge:${{ matrix.docker_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Build ${{ matrix.name }} package
run: |
bash utils/docker/build-manylinux.sh
- name: Upload rpm package to artifact
uses: actions/upload-artifact@v1
with:
name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.rpm
path: build/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.rpm
- name: Upload ${{ matrix.name }} tar.gz package to artifact
uses: actions/upload-artifact@v1
with:
name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.gz
path: build/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.tar.gz
- name: Upload ${{ matrix.name }} tar.xz package to artifact
uses: actions/upload-artifact@v1
with:
name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.xz
path: build/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.tar.xz
upload_manylinux_legacy:
strategy:
fail-fast: false
matrix:
include:
- name: manylinux1_x86_64
- name: manylinux2010_x86_64
name: Upload WasmEdge ${{ matrix.name }} package
needs: [create_release, build_on_manylinux_legacy]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download ${{ matrix.name }} rpm artifact
uses: actions/download-artifact@v1
with:
name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.rpm
- name: Verify the arifact
run: |
ls -alh .
ls -alh WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.rpm
- name: Upload ${{ matrix.name }} rpm package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.rpm/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.rpm
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.rpm
asset_content_type: application/x-rpm
- name: Download ${{ matrix.name }} tar.gz artifact
uses: actions/download-artifact@v1
with:
name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.gz
- name: Sleep 5 second to avoid GitHub ECONNRESET error
run: |
sleep 5
- name: Upload ${{ matrix.name }} tar.gz package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.gz/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.tar.gz
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.gz
asset_content_type: application/x-gzip
- name: Download ${{ matrix.name }} tar.xz artifact
uses: actions/download-artifact@v1
with:
name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.xz
- name: Sleep 5 second to avoid GitHub ECONNRESET error
run: |
sleep 5
- name: Upload ${{ matrix.name }} tar.xz package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.xz/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.tar.xz
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.xz
asset_content_type: application/x-xz
build_and_upload_manylinux2014:
strategy:
fail-fast: false
matrix:
include:
- name: manylinux2014_x86_64
docker_tag: manylinux2014_x86_64
host_runner: ubuntu-latest
- name: manylinux2014_aarch64
docker_tag: manylinux2014_aarch64
host_runner: ARM64
name: Build and upload WasmEdge on ${{ matrix.name }} platform
needs: create_release
runs-on: ${{ matrix.host_runner }}
container:
image: wasmedge/wasmedge:${{ matrix.docker_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build ${{ matrix.name }} package
run: |
bash utils/docker/build-manylinux.sh
- name: Upload ${{ matrix.name }} rpm package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.rpm
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.rpm
asset_content_type: application/x-rpm
- name: Sleep 5 second to avoid GitHub ECONNRESET error
run: |
sleep 5
- name: Upload ${{ matrix.name }} tar.gz package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.tar.gz
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.gz
asset_content_type: application/x-gzip
- name: Sleep 5 second to avoid GitHub ECONNRESET error
run: |
sleep 5
- name: Upload ${{ matrix.name }} tar.xz package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/WasmEdge-${{ needs.create_release.outputs.version }}-Linux.tar.xz
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-${{ matrix.name }}.tar.xz
asset_content_type: application/x-xz
build_windows:
name: Windows server 2022
runs-on: windows-2022
needs: create_release
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependency
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install cmake ninja vswhere
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v1
with:
sdk-version: 19041
- name: Build WasmEdge
run: |
$vsPath = (vswhere -latest -property installationPath)
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.19041.0"
$llvm = "LLVM-13.0.1-win64.zip"
curl -sLO https://github.com/WasmEdge/llvm-windows/releases/download/llvmorg-13.0.1/LLVM-13.0.1-win64.zip -o $llvm
Expand-Archive -Path $llvm
$llvm_dir = "$pwd\\LLVM-13.0.1-win64\\LLVM-13.0.1-win64\\lib\\cmake\\llvm"
$Env:CC = "clang-cl"
$Env:CXX = "clang-cl"
cmake -Bbuild -GNinja -DCMAKE_SYSTEM_VERSION=10.0.19041.0 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL "-DLLVM_DIR=$llvm_dir" -DWASMEDGE_BUILD_PACKAGE="ZIP" .
cmake --build build
- name: Create WasmEdge Package
run: |
$vsPath = (vswhere -latest -property installationPath)
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.19041.0"
cmake --build build --target package
- name: Upload Windows 10 zip package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build\\WasmEdge-${{ needs.create_release.outputs.version }}-Windows.zip
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-windows.zip
asset_content_type: application/zip
- name: Package Windows Installer
run: |
$Env:product_version = ("${{ needs.create_release.outputs.version }}").split("-")[0]
. "$Env:WIX\bin\candle.exe" -arch x64 -o build\wasmedge.wixobj .github\scripts\wasmedge.wxs
. "$Env:WIX\bin\light.exe" -out build\WasmEdge-${{ needs.create_release.outputs.version }}-windows.msi build\wasmedge.wixobj
- name: Upload Windows Installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build\\WasmEdge-${{ needs.create_release.outputs.version }}-windows.msi
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-windows.msi
asset_content_type: application/octet-stream
build_android:
name: Android
runs-on: ubuntu-latest
needs: create_release
container:
image: wasmedge/wasmedge:latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependency
run: |
apt update && apt install -y unzip
apt remove -y cmake
curl -sLO https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-linux-x86_64.tar.gz
tar -zxf cmake-3.22.2-linux-x86_64.tar.gz
cp -r cmake-3.22.2-linux-x86_64/bin /usr/local
cp -r cmake-3.22.2-linux-x86_64/share /usr/local
curl -sLO https://dl.google.com/android/repository/android-ndk-r23b-linux.zip
unzip -q android-ndk-r23b-linux.zip
- name: Build WasmEdge for Android
run: |
git config --global --add safe.directory $(pwd)
export ANDROID_NDK_HOME=$(pwd)/android-ndk-r23b/
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_PACKAGE="TGZ" -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=23 -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_ANDROID_NDK=$ANDROID_NDK_HOME -DCMAKE_ANDROID_STL_TYPE=c++_static
cmake --build build
cmake --build build --target package
- name: Upload tar.gz package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/WasmEdge-${{ needs.create_release.outputs.version }}-Android.tar.gz
asset_name: WasmEdge-${{ needs.create_release.outputs.version }}-android_aarch64.tar.gz
asset_content_type: application/x-gzip