appveyor.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. version: 1.0.{build}
  2. branches:
  3. only:
  4. - master
  5. image: Visual Studio 2022
  6. clone_folder: c:\gopath\src\github.com\mindoc-org\mindoc
  7. init:
  8. - cmd: >-
  9. if [%tbs_arch%]==[x86] SET PATH=C:\msys64\mingw32\bin;%PATH%
  10. if [%tbs_arch%]==[x64] SET PATH=C:\msys64\mingw64\bin;%PATH%
  11. SET PATH=%GOPATH%\bin;%GOBIN%;%PATH%
  12. FOR /f "delims=" %%i IN ('go version') DO (SET GO_VERSION=%%i)
  13. git config --global --add safe.directory /cygdrive/c/gopath/src/github.com/mindoc-org/mindoc
  14. environment:
  15. GOPATH: c:\gopath
  16. GOBIN: c:\gobin
  17. GO111MODULE: on
  18. CGO_ENABLED: 1
  19. matrix:
  20. - tbs_arch: x86
  21. GOARCH: 386
  22. job_name: job_x86
  23. - tbs_arch: x64
  24. GOARCH: amd64
  25. job_name: job_x64
  26. install:
  27. - cmd: >-
  28. echo %PATH%
  29. echo %GO_VERSION%
  30. go env
  31. where gcc
  32. where g++
  33. build_script:
  34. - cmd: >-
  35. cd c:\gopath\src\github.com\mindoc-org\mindoc
  36. go mod tidy -v
  37. go build -v -o "mindoc_windows_%GOARCH%.exe" -ldflags="-w -X github.com/mindoc-org/mindoc/conf.VERSION=%APPVEYOR_REPO_TAG_NAME% -X 'github.com/mindoc-org/mindoc/conf.BUILD_TIME=%date% %time%' -X 'github.com/mindoc-org/mindoc/conf.GO_VERSION=%GO_VERSION%'"
  38. 7z a -t7z -r mindoc_windows_%GOARCH%.7z conf/*.conf* conf/lang/* static/* mindoc_windows_%GOARCH%.exe views/* uploads/* lib/* favicon.ico LICENSE.md
  39. test_script:
  40. - cmd: >-
  41. cd c:\gopath\src\github.com\mindoc-org\mindoc
  42. pwsh -NoProfile -ExecutionPolicy Bypass -Command "& {Copy-Item -Force -Path 'conf\app.conf.example' -Destination 'conf\app.conf'}"
  43. mindoc_windows_%GOARCH%.exe version
  44. artifacts:
  45. - path: mindoc_windows_*.7z
  46. deploy: off