1#!/bin/bash
2
3set -ex
4
5# Determine the name of the tarball
6tag=dev
7if [[ $GITHUB_REF == refs/heads/release-* ]]; then
8  tag=v$(./ci/print-current-version.sh)
9fi
10pkgname=wasmtime-$tag-src
11
12# Vendor all crates.io dependencies since this is supposed to be an
13# offline-only-compatible tarball
14mkdir .cargo
15cargo vendor > .cargo/config.toml
16
17# Create the tarball from the destination
18tar -czf /tmp/$pkgname.tar.gz --transform "s/^\./$pkgname/S" --exclude=.git .
19mkdir -p dist
20mv /tmp/$pkgname.tar.gz dist/
21
22rm .cargo/config.toml
23