appveyor.yml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. # shallow clone
  2. clone_depth: 10
  3. cache:
  4. - C:\ProgramData\chocolatey\bin -> appveyor.yml
  5. - C:\ProgramData\chocolatey\lib -> appveyor.yml
  6. os: Visual Studio 2017
  7. environment:
  8. # Tell msys2 to add mingw64 to the path
  9. MSYSTEM: MINGW64
  10. # Tell msys2 to inherit the current directory when starting the shell
  11. CHERE_INVOKING: 1
  12. matrix:
  13. - BUILD_TYPE: mingw
  14. - BUILD_TYPE: msvc
  15. platform:
  16. - x64
  17. configuration:
  18. - Release
  19. install:
  20. - git submodule update --init --recursive
  21. - ps: |
  22. if ($env:BUILD_TYPE -eq 'mingw') {
  23. $dependencies = "mingw64/mingw-w64-x86_64-cmake",
  24. "mingw64/mingw-w64-x86_64-qt5",
  25. "mingw64/mingw-w64-x86_64-SDL2"
  26. # redirect err to null to prevent warnings from becoming errors
  27. # workaround to prevent pacman from failing due to cyclical dependencies
  28. C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw64/mingw-w64-x86_64-freetype mingw64/mingw-w64-x86_64-fontconfig" 2> $null
  29. C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S $dependencies" 2> $null
  30. }
  31. before_build:
  32. - mkdir %BUILD_TYPE%_build
  33. - cd %BUILD_TYPE%_build
  34. - ps: |
  35. if ($env:BUILD_TYPE -eq 'msvc') {
  36. # redirect stderr and change the exit code to prevent powershell from cancelling the build if cmake prints a warning
  37. cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_BUNDLED_UNICORN=1 .. 2>&1 && exit 0'
  38. } else {
  39. C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DYUZU_BUILD_UNICORN=1 -DCMAKE_BUILD_TYPE=Release .. 2>&1"
  40. }
  41. - cd ..
  42. build_script:
  43. - ps: |
  44. if ($env:BUILD_TYPE -eq 'msvc') {
  45. # https://www.appveyor.com/docs/build-phase
  46. msbuild msvc_build/yuzu.sln /maxcpucount /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
  47. } else {
  48. C:\msys64\usr\bin\bash.exe -lc 'mingw32-make -C mingw_build/ 2>&1'
  49. }
  50. after_build:
  51. - ps: |
  52. $GITDATE = $(git show -s --date=short --format='%ad') -replace "-",""
  53. $GITREV = $(git show -s --format='%h')
  54. # Find out which kind of release we are producing by tag name
  55. if ($env:APPVEYOR_REPO_TAG_NAME) {
  56. $RELEASE_DIST, $RELEASE_VERSION = $env:APPVEYOR_REPO_TAG_NAME.split('-')
  57. } else {
  58. # There is no repo tag - make assumptions
  59. $RELEASE_DIST = "head"
  60. }
  61. if ($env:BUILD_TYPE -eq 'msvc') {
  62. # Where are these spaces coming from? Regardless, let's remove them
  63. $MSVC_BUILD_ZIP = "yuzu-windows-msvc-$GITDATE-$GITREV.zip" -replace " ", ""
  64. $MSVC_BUILD_PDB = "yuzu-windows-msvc-$GITDATE-$GITREV-debugsymbols.zip" -replace " ", ""
  65. $MSVC_SEVENZIP = "yuzu-windows-msvc-$GITDATE-$GITREV.7z" -replace " ", ""
  66. # set the build names as env vars so the artifacts can upload them
  67. $env:BUILD_ZIP = $MSVC_BUILD_ZIP
  68. $env:BUILD_SYMBOLS = $MSVC_BUILD_PDB
  69. $env:BUILD_UPDATE = $MSVC_SEVENZIP
  70. mkdir pdb
  71. Get-ChildItem ".\msvc_build\bin\" -Recurse -Filter "*.pdb" | Copy-Item -destination .\pdb
  72. 7z a -tzip $MSVC_BUILD_PDB .\pdb\*.pdb
  73. mkdir $RELEASE_DIST
  74. Get-ChildItem ".\msvc_build\bin\" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
  75. Copy-Item .\license.txt -Destination $RELEASE_DIST
  76. Copy-Item .\README.md -Destination $RELEASE_DIST
  77. 7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\*
  78. 7z a $MSVC_SEVENZIP $RELEASE_DIST
  79. } else {
  80. $MINGW_BUILD_ZIP = "yuzu-windows-mingw-$GITDATE-$GITREV.zip" -replace " ", ""
  81. $MINGW_SEVENZIP = "yuzu-windows-mingw-$GITDATE-$GITREV.7z" -replace " ", ""
  82. # not going to bother adding separate debug symbols for mingw, so just upload a README for it
  83. # if someone wants to add them, change mingw to compile with -g and use objdump and strip to separate the symbols from the binary
  84. $MINGW_NO_DEBUG_SYMBOLS = "README_No_Debug_Symbols.txt"
  85. Set-Content -Path $MINGW_NO_DEBUG_SYMBOLS -Value "This is a workaround for Appveyor since msvc has debug symbols but mingw doesnt" -Force
  86. # store the build information in env vars so we can use them as artifacts
  87. $env:BUILD_ZIP = $MINGW_BUILD_ZIP
  88. $env:BUILD_SYMBOLS = $MINGW_NO_DEBUG_SYMBOLS
  89. $env:BUILD_UPDATE = $MINGW_SEVENZIP
  90. $CMAKE_SOURCE_DIR = "$env:APPVEYOR_BUILD_FOLDER"
  91. $CMAKE_BINARY_DIR = "$CMAKE_SOURCE_DIR/mingw_build/bin"
  92. $RELEASE_DIST = $RELEASE_DIST + "-mingw"
  93. mkdir $RELEASE_DIST
  94. mkdir $RELEASE_DIST/platforms
  95. # copy the compiled binaries and other release files to the release folder
  96. Get-ChildItem "$CMAKE_BINARY_DIR" -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
  97. Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST
  98. Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST
  99. # copy all the dll dependencies to the release folder
  100. # hardcoded list because we don't build static and determining the list of dlls from the binary is a pain.
  101. $MingwDLLs = "Qt5Core.dll","Qt5Widgets.dll","Qt5Gui.dll","Qt5OpenGL.dll",
  102. # QT dll dependencies
  103. "libbz2-*.dll","libicudt*.dll","libicuin*.dll","libicuuc*.dll","libffi-*.dll",
  104. "libfreetype-*.dll","libglib-*.dll","libgobject-*.dll","libgraphite2.dll","libiconv-*.dll",
  105. "libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre2-16-*.dll","libpcre16-*.dll","libpng16-*.dll",
  106. # Runtime/Other dependencies
  107. "libgcc_s_seh-*.dll","libstdc++-*.dll","libwinpthread-*.dll","SDL2.dll","zlib1.dll"
  108. foreach ($file in $MingwDLLs) {
  109. Copy-Item -path "C:/msys64/mingw64/bin/$file" -force -destination "$RELEASE_DIST"
  110. }
  111. # the above list copies a few extra debug dlls that aren't needed (thanks globbing patterns!)
  112. # so we can remove them by hardcoding another list of extra dlls to remove
  113. $DebugDLLs = "libicudtd*.dll","libicuind*.dll","libicuucd*.dll"
  114. foreach ($file in $DebugDLLs) {
  115. Remove-Item -path "$RELEASE_DIST/$file"
  116. }
  117. # copy the qt windows plugin dll to platforms
  118. Copy-Item -path "C:/msys64/mingw64/share/qt5/plugins/platforms/qwindows.dll" -force -destination "$RELEASE_DIST/platforms"
  119. 7z a -tzip $MINGW_BUILD_ZIP $RELEASE_DIST\*
  120. 7z a $MINGW_SEVENZIP $RELEASE_DIST
  121. }
  122. test_script:
  123. - cd %BUILD_TYPE%_build
  124. - ps: |
  125. if ($env:BUILD_TYPE -eq 'msvc') {
  126. ctest -VV -C Release
  127. } else {
  128. C:\msys64\usr\bin\bash.exe -lc "ctest -VV -C Release"
  129. }
  130. - cd ..
  131. artifacts:
  132. - path: $(BUILD_ZIP)
  133. name: build
  134. type: zip
  135. - path: $(BUILD_SYMBOLS)
  136. name: debugsymbols
  137. - path: $(BUILD_UPDATE)
  138. name: update
  139. deploy:
  140. provider: GitHub
  141. release: $(appveyor_repo_tag_name)
  142. auth_token:
  143. secure: "argb6oi2TYLB4wDy+HoCC8PuGAmsnocSk12CQ5614XAPO+NVPndlkLv1utnDFfg2"
  144. artifact: update,build
  145. draft: false
  146. prerelease: false
  147. on:
  148. appveyor_repo_tag: true