appveyor.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. version: "{build}"
  2. clone_folder: c:\gopath\src\github.com\lifei6671\godoc
  3. environment:
  4. GOPATH: c:\gopath
  5. GOVERSION: 1.8
  6. matrix:
  7. - tbs_arch: "x86"
  8. tbs_tools: "mingw"
  9. tbs_static_runtime: 1
  10. GOARCH: 386
  11. - tbs_arch: "x64"
  12. tbs_tools: "mingw"
  13. tbs_static_runtime: 1
  14. GOARCH: amd64
  15. install:
  16. - ps: if($env:tbs_tools -eq 'mingw' -and $env:tbs_arch -eq 'x64')
  17. {
  18. Start-FileDownload "http://libgd.blob.core.windows.net/mingw/x86_64-4.9.1-release-posix-seh-rt_v3-rev1.7z" -FileName mingw_x86_64.7z;
  19. 7z x -oC:\ mingw_x86_64.7z | out-null;
  20. }
  21. - ps: if($env:tbs_tools -eq 'mingw' -and $env:tbs_arch -eq 'x86')
  22. {
  23. Start-FileDownload "http://libgd.blob.core.windows.net/mingw/i686-4.9.1-release-posix-dwarf-rt_v3-rev1.7z" -FileName mingw_x86.7z;
  24. 7z x -oC:\ mingw_x86.7z | out-null;
  25. }
  26. - echo %PATH%
  27. - echo %GOPATH%
  28. - go version
  29. - go env
  30. - go get -d ./...
  31. build_script:
  32. - if [%tbs_tools%]==[mingw] if [%tbs_arch%]==[x86] SET PATH=C:\mingw32\bin;%PATH%
  33. - if [%tbs_tools%]==[mingw] if [%tbs_arch%]==[x64] SET PATH=C:\mingw64\bin;%PATH%
  34. - set CGO_ENABLED=1
  35. - go build -v -o "godoc_windows_%GOARCH%.exe" -ldflags="-w -X github.com/lifei6671/godoc/conf.VERSION=%APPVEYOR_REPO_TAG_NAME% -X 'github.com/lifei6671/godoc/conf.BUILD_TIME=`date`' -X 'conf.GO_VERSION=`github.com/lifei6671/godoc/go version`'"
  36. - 7z a -t7z -r godoc_windows_%GOARCH%.7z conf/*.conf* static/* godoc_windows_%GOARCH%.exe views/* uploads/*
  37. test_script:
  38. - if [%tbs_arch%]==[x86] godoc_windows_386.exe version
  39. - if [%tbs_arch%]==[x64] godoc_windows_amd64.exe version
  40. notifications:
  41. - provider: Email
  42. to:
  43. - [email protected]
  44. on_build_success: false
  45. artifacts:
  46. - path: godoc_windows_%GOARCH%.7z
  47. name: Releases
  48. deploy:
  49. - provider: GitHub
  50. auth_token:
  51. secure: "Qkhxloft5lBKti7O+vVS+Vrxh7CBAUVhlfdZ9ptBXjFtjt6jHXnaBA2uv2OYbISB"
  52. draft: false
  53. prerelease: false
  54. artifact: godoc_windows_%GOARCH%.7z
  55. on:
  56. appveyor_repo_tag: true