Files
wasmtime/ci/build-tarballs.sh
Alex Crichton 364fa994ed Move the C API to a separate crate (#818)
* Move the C API to a separate crate

This commit moves the C API from `crates/api/src/wasm.rs` to
`crates/capi/src/lib.rs` to be located in a separate crate. There's a
number of reasons for this:

* When a Rust program depends on the `wasmtime` crate, there's no need
  to compile in the C API.
* This should improve compile times of the `wasmtime` crate since it's
  not producing artifacts which aren't always used.
* The development of the C API can be guaranteed to only use the public
  API of the `wasmtime` crate itself.

Some CI pieces are tweaked and this overall shouldn't have much impact
on users, it's intended that it's a cleanup/speedup for developers!

* Disable rustdoc/tests for capi

* Review feedback

* Add back in accidentally deleted comment

* More renamings

* Try to fix dotnet build
2020-01-14 11:36:57 -08:00

56 lines
1.5 KiB
Bash
Executable File

#!/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/c-api/examples/wasm-c-api/include/wasm.h tmp/$api_pkgname/include
mktarball $api_pkgname
# Move wheels to dist folder
mv wheels-$src/* dist