.travis.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. os: linux
  2. dist: focal
  3. language: go
  4. go:
  5. - "1.18.1"
  6. arch:
  7. - amd64
  8. env:
  9. - GO111MODULE=on CGO_ENABLED=1
  10. install:
  11. - go mod tidy -v
  12. before_install:
  13. - whereis gcc
  14. - go env
  15. script:
  16. - go build -o mindoc_linux_amd64 -ldflags "-w"
  17. - cp conf/app.conf.example conf/app.conf
  18. - ./mindoc_linux_amd64 version
  19. - rm conf/app.conf
  20. before_deploy:
  21. - 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`'"
  22. # remove files
  23. - 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
  24. # remove dirs
  25. - rm -rf cache commands controllers converter .git .github graphics mail models routers utils runtime
  26. - ls -alh
  27. - cp conf/app.conf.example conf/app.conf
  28. - zip -r mindoc_linux_amd64.zip conf static uploads views lib mindoc_linux_amd64 LICENSE.md
  29. deploy:
  30. provider: releases
  31. token: $CI_USER_TOKEN
  32. cleanup: true
  33. overwrite: true
  34. file:
  35. - mindoc_linux_amd64.zip
  36. on:
  37. tags: true
  38. branch: master