Skip to content

Commit

Permalink
build: Create tarball with vendored sources. Fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
1player committed Oct 12, 2022
1 parent caed8c0 commit 1b0b10d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
host-spawn
build
vendor/
14 changes: 13 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -euo pipefail

ARCH="
386-i386
386-i686
Expand All @@ -8,12 +10,22 @@ ARCH="
arm64-aarch64
"

ROOT_DIR=$(dirname "$0")
VERSION=${VERSION:-HEAD}

cd "$ROOT_DIR"

mkdir -p build

echo $VERSION
echo "$VERSION"

for architecture in ${ARCH}; do
CGO_ENABLED=0 GOARCH="$(echo "${architecture}" | cut -d'-' -f1)" go build \
-ldflags "-X main.Version=$VERSION" \
-o build/host-spawn-"$(echo "${architecture}" | cut -d'-' -f2)"
done

# Create source tarball including vendored dependencies
git clean -fdx -e build
go mod vendor
tar --create --zst --exclude build --file build/host-spawn-vendor.tar.zst "$ROOT_DIR"

0 comments on commit 1b0b10d

Please sign in to comment.