You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.5 KiB
55 lines
1.5 KiB
#!/bin/bash
|
|
|
|
# A small shell script invoked from CI on the final Linux builder which actually
|
|
# assembles the release artifacts for a particular platform. This will take the
|
|
# binary artifacts of previous builders and create associated tarballs to
|
|
# publish to GitHub.
|
|
#
|
|
# The first argument of this is the "platform" name to put into the tarball, and
|
|
# the second argument is the name of the github actions platform which is where
|
|
# we source binaries from. The final third argument is ".exe" on Windows to
|
|
# handle executable extensions right.
|
|
|
|
set -ex
|
|
|
|
platform=$1
|
|
src=$2
|
|
exe=$3
|
|
|
|
rm -rf tmp
|
|
mkdir tmp
|
|
mkdir -p dist
|
|
|
|
mktarball() {
|
|
dir=$1
|
|
if [ "$exe" = "" ]; then
|
|
tar cJf dist/$dir.tar.xz -C tmp $dir
|
|
else
|
|
(cd tmp && zip -r ../dist/$dir.zip $dir)
|
|
fi
|
|
}
|
|
|
|
# Create the main tarball of binaries
|
|
bin_pkgname=wasmtime-$TAG-$platform
|
|
mkdir tmp/$bin_pkgname
|
|
cp LICENSE README.md tmp/$bin_pkgname
|
|
mv bins-$src/{wasmtime,wasm2obj}$exe tmp/$bin_pkgname
|
|
chmod +x tmp/$bin_pkgname/{wasmtime,wasm2obj}$exe
|
|
mktarball $bin_pkgname
|
|
|
|
if [ "$exe" = ".exe" ]; then
|
|
mv bins-$src/installer.msi dist/$bin_pkgname.msi
|
|
fi
|
|
|
|
# Create tarball of API libraries
|
|
api_pkgname=wasmtime-$TAG-$platform-c-api
|
|
mkdir tmp/$api_pkgname
|
|
mkdir tmp/$api_pkgname/lib
|
|
mkdir tmp/$api_pkgname/include
|
|
cp LICENSE README.md tmp/$api_pkgname
|
|
mv bins-$src/* tmp/$api_pkgname/lib
|
|
cp crates/api/c-examples/wasm-c-api/include/wasm.h tmp/$api_pkgname/include
|
|
mktarball $api_pkgname
|
|
|
|
# Move wheels to dist folder
|
|
mv wheels-$src/* dist
|
|
|