forked from mindoc-org/mindoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_musl_amd64.sh
20 lines (16 loc) · 1.02 KB
/
build_musl_amd64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
rm mindoc_linux_musl_amd64 mindoc_linux_amd64
rm -rf ../mindoc_linux_musl_amd64/
export GOARCH=amd64
export GOOS=linux
export CC=/usr/local/musl/bin/musl-gcc
export TRAVIS_TAG=v2.1-beta.6
go mod tidy -v
go build -v -o mindoc_linux_musl_amd64 -ldflags="-linkmode external -extldflags '-static' -w -X 'github.com/mindoc-org/mindoc/conf.VERSION=$TRAVIS_TAG' -X 'github.com/mindoc-org/mindoc/conf.BUILD_TIME=`date`' -X 'github.com/mindoc-org/mindoc/conf.GO_VERSION=`go version`'"
./mindoc_linux_musl_amd64 version
mkdir ../mindoc_linux_musl_amd64
cp -r * ../mindoc_linux_musl_amd64
cd ../mindoc_linux_musl_amd64
rm -rf cache commands controllers converter .git .github graphics mail models routers utils runtime conf/*.go
rm appveyor.yml docker-compose.yml Dockerfile .travis.yml .gitattributes .gitignore go.mod go.sum main.go README.md simsun.ttc start.sh sync_host.sh build_amd64.sh build_musl_amd64.sh
zip -r mindoc_linux_musl_amd64.zip conf static uploads views lib mindoc_linux_musl_amd64 LICENSE.md
mv ./mindoc_linux_musl_amd64.zip ../