forked from mindoc-org/mindoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
46 lines (38 loc) · 1.2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
os: linux
dist: focal
language: go
go:
- "1.18.1"
arch:
- amd64
env:
- GO111MODULE=on CGO_ENABLED=1
install:
- go mod tidy -v
before_install:
- whereis gcc
- go env
script:
- go build -o mindoc_linux_amd64 -ldflags "-w"
- cp conf/app.conf.example conf/app.conf
- ./mindoc_linux_amd64 version
- rm conf/app.conf
before_deploy:
- go mod tidy -v && GOARCH=amd64 GOOS=linux go build -v -o mindoc_linux_amd64 -ldflags="-w -X 'github.com/mindoc-org/mindoc/conf.VERSION=$TRAVIS_TAG' -X 'github.com/mindoc-org/mindoc/conf.BUILD_TIME=`date`' -X 'conf.GO_VERSION=`go version`'"
# remove files
- 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
# remove dirs
- rm -rf cache commands controllers converter .git .github graphics mail models routers utils runtime
- ls -alh
- cp conf/app.conf.example conf/app.conf
- zip -r mindoc_linux_amd64.zip conf static uploads views lib mindoc_linux_amd64 LICENSE.md
deploy:
provider: releases
token: $CI_USER_TOKEN
cleanup: true
overwrite: true
file:
- mindoc_linux_amd64.zip
on:
tags: true
branch: master