chore: renew github flow

This commit is contained in:
deepzz0
2021-04-29 10:44:43 +08:00
parent a2769f0913
commit 1c955769f4
8 changed files with 62 additions and 53 deletions

27
scripts/dist_tar.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env sh
set -e
_tag="$1"
_arch=$(go env GOARCH)
# prepare dir ./bin
mkdir -p ./bin
for file in pkg/core/*; do
app="$(basename $file)";
# tar platform
for os in linux darwin windows; do
_target="$app-$_tag.$os-$_arch.tar.gz"
CGO_ENABLED=0 GOOS=$os GOARCH=$_arch \
go build -o bin/backend "./cmd/$app"
if [ "$app" == "blog" ]; then
tar czf $_target conf website assets bin/backend
else
tar czf $_target conf bin/backend
fi
done
done
# clean dir ./bin
rm -rf ./bin