Files
wasmtime/ci/build-tarballs.sh
Alex Crichton aa7f1757c5 Add a MinGW release to our CI
This commit extends our CI to produce release artifacts for the
x86_64-pc-windows-gnu target. This was originally motivate by the [go
extension] where it looks like the Go toolchain primarily interoperates
with MinGW, not with MSVC natively.

The support here turned out to be quite trivial, largely just adding the
configuration to make the release. I don't think we should necessarily
commit to this being a primary platform for Wasmtime at this time
though. If the support here regresses in the future for a
difficult-to-fix reason I think it would be fine to back out the
platform at least temporarily.

Note that this does not add a full test suite for the MinGW target, only
a release builder. This release builder does run tests, but not with
full debug assertions enabled.

[go extension]: https://github.com/bytecodealliance/wasmtime-go/issues/3

Closes #1535
2020-04-22 15:54:46 -07:00

57 lines
1.6 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.
#
# Usage: build-tarballs.sh PLATFORM [.exe]
# where PLATFORM is e.g. x86_64-linux, aarch64-linux, ...
set -ex
platform=$1
exe=$2
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-$platform/wasmtime$exe tmp/$bin_pkgname
chmod +x tmp/$bin_pkgname/wasmtime$exe
mktarball $bin_pkgname
if [ -f bins-$platform/installer.msi ]; then
mv bins-$platform/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-$platform/* tmp/$api_pkgname/lib
cp crates/c-api/wasm-c-api/include/wasm.h tmp/$api_pkgname/include
cp crates/c-api/include/{wasmtime,wasi}.h tmp/$api_pkgname/include
mktarball $api_pkgname