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:
|
2022-05-07 18:46:48 +08:00
|
|
|
- "1.18.1"
|
2017-05-08 17:38:35 +08:00
|
|
|
|
2021-04-01 14:19:08 +08:00
|
|
|
arch:
|
|
|
|
- amd64
|
|
|
|
|
|
|
|
env:
|
2021-04-01 14:35:20 +08:00
|
|
|
- GO111MODULE=on CGO_ENABLED=1
|
2021-04-01 14:19:08 +08:00
|
|
|
|
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:
|
2022-05-13 17:19:28 +08:00
|
|
|
- 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`'"
|
2021-04-01 14:19:08 +08:00
|
|
|
# remove files
|
2022-05-13 17:19:28 +08:00
|
|
|
- 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
|
2021-04-01 14:19:08 +08:00
|
|
|
# remove dirs
|
2022-05-13 17:19:28 +08:00
|
|
|
- rm -rf cache commands controllers converter .git .github graphics mail models routers utils runtime
|
2021-04-01 14:19:08 +08:00
|
|
|
- ls -alh
|
2017-05-09 10:33:02 +08:00
|
|
|
- cp conf/app.conf.example conf/app.conf
|
2022-07-20 15:04:01 +08:00
|
|
|
- zip -r mindoc_linux_amd64.zip conf static uploads views lib mindoc_linux_amd64 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
|