-
Notifications
You must be signed in to change notification settings - Fork 1
/
update-extism.sh
executable file
·53 lines (39 loc) · 4.48 KB
/
update-extism.sh
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
# EXTISM_REPO=extism
EXTISM_REPO=MAIF
EXTISM_VERSION=$(curl https://api.github.com/repos/${EXTISM_REPO}/extism/releases/latest | jq -r '.name')
echo "latest extism version is: ${EXTISM_VERSION}"
rm -rfv ./src/main/resources/native
rm -rfv ./src/main/resources/darwin-*
rm -rfv ./src/main/resources/linux-*
rm -rfv ./src/main/resources/win*
mkdir ./src/main/resources/native
curl -L -o "./src/main/resources/native/libextism-aarch64-apple-darwin-${EXTISM_VERSION}.tar.gz" "https://github.com/${EXTISM_REPO}/extism/releases/download/${EXTISM_VERSION}/libextism-aarch64-apple-darwin-${EXTISM_VERSION}.tar.gz"
curl -L -o "./src/main/resources/native/libextism-x86_64-apple-darwin-${EXTISM_VERSION}.tar.gz" "https://github.com/${EXTISM_REPO}/extism/releases/download/${EXTISM_VERSION}/libextism-x86_64-apple-darwin-${EXTISM_VERSION}.tar.gz"
curl -L -o "./src/main/resources/native/libextism-x86_64-unknown-linux-gnu-${EXTISM_VERSION}.tar.gz" "https://github.com/${EXTISM_REPO}/extism/releases/download/${EXTISM_VERSION}/libextism-x86_64-unknown-linux-gnu-${EXTISM_VERSION}.tar.gz"
curl -L -o "./src/main/resources/native/libextism-aarch64-unknown-linux-gnu-${EXTISM_VERSION}.tar.gz" "https://github.com/${EXTISM_REPO}/extism/releases/download/${EXTISM_VERSION}/libextism-aarch64-unknown-linux-gnu-${EXTISM_VERSION}.tar.gz"
curl -L -o "./src/main/resources/native/libextism-x86_64-pc-windows-gnu-${EXTISM_VERSION}.tar.gz" "https://github.com/${EXTISM_REPO}/extism/releases/download/${EXTISM_VERSION}/libextism-x86_64-pc-windows-gnu-${EXTISM_VERSION}.tar.gz"
# curl -L -o "./src/main/resources/native/libextism-x86_64-pc-windows-msvc-${EXTISM_VERSION}.tar.gz" "https://github.com/${EXTISM_REPO}/extism/releases/download/${EXTISM_VERSION}/libextism-x86_64-pc-windows-msvc-${EXTISM_VERSION}.tar.gz"
curl -L -o "./lib/extism-${EXTISM_VERSION}.jar" "https://github.com/${EXTISM_REPO}/extism/releases/download/${EXTISM_VERSION}/extism-${EXTISM_VERSION}.jar"
mkdir ./src/main/resources/darwin-aarch64
mkdir ./src/main/resources/darwin-x86-64
mkdir ./src/main/resources/linux-aarch64
mkdir ./src/main/resources/linux-x86-64
mkdir ./src/main/resources/win32-x86-64
tar -xvf "./src/main/resources/native/libextism-aarch64-apple-darwin-${EXTISM_VERSION}.tar.gz" --directory ./src/main/resources/native/
mv ./src/main/resources/native/libextism.dylib ./src/main/resources/darwin-aarch64/libextism.dylib
tar -xvf "./src/main/resources/native/libextism-x86_64-apple-darwin-${EXTISM_VERSION}.tar.gz" --directory ./src/main/resources/native/
mv ./src/main/resources/native/libextism.dylib ./src/main/resources/darwin-x86-64/libextism.dylib
tar -xvf "./src/main/resources/native/libextism-aarch64-unknown-linux-gnu-${EXTISM_VERSION}.tar.gz" --directory ./src/main/resources/native/
mv ./src/main/resources/native/libextism.so ./src/main/resources/linux-aarch64/libextism.so
tar -xvf "./src/main/resources/native/libextism-x86_64-unknown-linux-gnu-${EXTISM_VERSION}.tar.gz" --directory ./src/main/resources/native/
mv ./src/main/resources/native/libextism.so ./src/main/resources/linux-x86-64/libextism.so
tar -xvf "./src/main/resources/native/libextism-x86_64-pc-windows-gnu-${EXTISM_VERSION}.tar.gz" --directory ./src/main/resources/native/
# tar -xvf "./src/main/resources/native/libextism-x86_64-pc-windows-msvc-${EXTISM_VERSION}.tar.gz" --directory ./src/main/resources/native/
mv ./src/main/resources/native/extism.dll ./src/main/resources/win32-x86-64/extism.dll
rm -rfv ./src/main/resources/native
# curl -L -o "./src/main/resources/native/libextism-aarch64-unknown-linux-musl-${EXTISM_VERSION}.tar.gz" "https://github.com/extism/extism/releases/download/${EXTISM_VERSION}/libextism-aarch64-unknown-linux-musl-${EXTISM_VERSION}.tar.gz"
# tar -xvf "./src/main/resources/native/libextism-aarch64-unknown-linux-musl-${EXTISM_VERSION}.tar.gz" --directory ./src/main/resources/native/
# curl -L -o "./src/main/resources/native/libextism-x86_64-pc-windows-gnu-${EXTISM_VERSION}.tar.gz" "https://github.com/extism/extism/releases/download/${EXTISM_VERSION}/libextism-x86_64-pc-windows-gnu-${EXTISM_VERSION}.tar.gz"
# curl -L -o "./src/main/resources/native/libextism-x86_64-pc-windows-msvc-${EXTISM_VERSION}.tar.gz" "https://github.com/extism/extism/releases/download/${EXTISM_VERSION}/libextism-x86_64-pc-windows-msvc-${EXTISM_VERSION}.tar.gz"
# mv ./src/main/resources/native/libextism.so ./src/main/resources/native/libextism-aarch64-unknown-linux-musl.so
# tar -xvf "./src/main/resources/native/libextism-x86_64-pc-windows-gnu-${EXTISM_VERSION}.tar.gz" --directory ./src/main/resources/native/