mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-11 15:33:31 -07:00
(minor) refactor build script
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
out=$1
|
||||
|
||||
src="$PWD"
|
||||
|
||||
vv="`git describe --tags --abbrev=0`"
|
||||
tt="`TZ=UTC date +'%Z %F'`"
|
||||
|
||||
tar -czf /out/"mochi-${vv}-linux-amd64.tar.gz" --owner=root --group=root --numeric-owner --mtime="${tt}" "mochi-${vv}-linux-amd64"
|
||||
tar -czf /out/"mochi-${vv}-linux-aarch64.tar.gz" --owner=root --group=root --numeric-owner --mtime="${tt}" "mochi-${vv}-linux-aarch64"
|
||||
for arch in amd64 arm64; do
|
||||
arch_out="mochi-${vv}-linux-${arch}"
|
||||
mkdir -p "$out/$arch_out"
|
||||
cp dist/example_config*.yaml "$out/$arch_out/"
|
||||
CGO_ENABLED=0 GOARCH=${arch} go build -trimpath -o "$out/$arch_out/mochi" ./cmd/mochi
|
||||
strip "$out/$arch_out/mochi"
|
||||
cd "$out"
|
||||
tar -czf "${arch_out}".tar.gz --owner=root --group=root --numeric-owner --mtime="${tt}" "$arch_out"
|
||||
cd "$src"
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user