2021-04-01 14:19:08 +08:00
|
|
|
os: linux
|
|
|
|
dist: focal
|
2017-05-08 17:19:02 +08:00
|
|
|
|
2021-04-01 14:19:08 +08:00
|
|
|
language: go
|
2017-05-08 17:19:02 +08:00
|
|
|
go:
|
2019-03-04 15:08:59 +08:00
|
|
|
- "1.12"
|
2017-05-08 17:38:35 +08:00
|
|
|
|
2021-04-01 14:19:08 +08:00
|
|
|
arch:
|
|
|
|
- amd64
|
|
|
|
|
|
|
|
env:
|
|
|
|
- GO111MODULE: on
|
|
|
|
- CGO_ENABLED: 1
|
|
|
|
|
2019-03-04 15:58:55 +08:00
|
|
|
install:
|
2021-04-01 14:19:08 +08:00
|
|
|
- go mod tidy -v
|
2017-05-08 17:38:35 +08:00
|
|
|
|
|
|
|
before_install:
|
2021-04-01 14:19:08 +08:00
|
|
|
- whereis gcc
|
|
|
|
- go env
|
2017-05-08 17:38:35 +08:00
|
|
|
|
|
|
|
script:
|
2021-04-01 14:19:08 +08:00
|
|
|
- go build -o mindoc_linux_amd64 -ldflags "-w"
|
|
|
|
- cp conf/app.conf.example conf/app.conf
|
|
|
|
- ./mindoc_linux_amd64 version
|
|
|
|
- rm conf/app.conf
|
2017-05-08 17:19:02 +08:00
|
|
|
|
2017-05-08 17:25:31 +08:00
|
|
|
before_deploy:
|
2021-04-01 14:19:08 +08:00
|
|
|
- go mod tidy -v && GOARCH=amd64 GOOS=linux go build -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
|
|
|
|
# remove dirs
|
|
|
|
- rm -rf cache commands controllers converter .git .github graphics mail models routers utils
|
|
|
|
- ls -alh
|
2017-05-09 10:33:02 +08:00
|
|
|
- cp conf/app.conf.example conf/app.conf
|
2021-04-01 14:19:08 +08:00
|
|
|
- zip -r mindoc_linux_amd64.zip conf static uploads views lib mindoc_linux_amd64 favicon.ico LICENSE.md
|
2017-07-10 18:05:21 +08:00
|
|
|
|
2017-05-08 17:19:02 +08:00
|
|
|
deploy:
|
|
|
|
provider: releases
|
2021-04-01 14:19:08 +08:00
|
|
|
token: $CI_USER_TOKEN
|
|
|
|
cleanup: true
|
|
|
|
overwrite: true
|
2017-05-08 17:19:02 +08:00
|
|
|
file:
|
2017-06-14 09:29:08 +08:00
|
|
|
- mindoc_linux_amd64.zip
|
2017-05-08 17:19:02 +08:00
|
|
|
on:
|
|
|
|
tags: true
|
2021-04-01 14:19:08 +08:00
|
|
|
branch: master
|