diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f24170844a..e827508b63 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -407,6 +407,10 @@ jobs: - uses: actions/checkout@v2 with: submodules: true + # On one builder produce the source tarball since there's no need to produce + # it everywhere + - run: ./ci/build-src-tarball.sh + if: matrix.build == 'x86_64-linux' - uses: ./.github/actions/install-rust - uses: ./.github/actions/binary-compatible-builds with: diff --git a/ci/build-src-tarball.sh b/ci/build-src-tarball.sh new file mode 100755 index 0000000000..ad7e5c916c --- /dev/null +++ b/ci/build-src-tarball.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -ex + +# Determine the name of the tarball +tag=dev +if [[ $GITHUB_REF == refs/tags/v* ]]; then + tag=${GITHUB_REF#refs/tags/} +fi +pkgname=wasmtime-$tag-src + +# Vendor all crates.io dependencies since this is supposed to be an +# offline-only-compatible tarball +mkdir .cargo +cargo vendor > .cargo/config.toml + +# Create the tarball from the destination +tar -czf /tmp/$pkgname.tar.gz --transform "s/^\./$pkgname/S" --exclude=.git . +mkdir -p dist +mv /tmp/$pkgname.tar.gz dist/