upload.ps1 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. param($BUILD_NAME)
  2. $GITDATE = $(git show -s --date=short --format='%ad') -replace "-", ""
  3. $GITREV = $(git show -s --format='%h')
  4. if ("$BUILD_NAME" -eq "mainline") {
  5. $RELEASE_DIST = "yuzu-windows-msvc"
  6. }
  7. else {
  8. $RELEASE_DIST = "yuzu-windows-msvc-$BUILD_NAME"
  9. }
  10. $MSVC_BUILD_ZIP = "yuzu-windows-msvc-$GITDATE-$GITREV.zip" -replace " ", ""
  11. $MSVC_BUILD_PDB = "yuzu-windows-msvc-$GITDATE-$GITREV-debugsymbols.zip" -replace " ", ""
  12. $MSVC_SEVENZIP = "yuzu-windows-msvc-$GITDATE-$GITREV.7z" -replace " ", ""
  13. $MSVC_TAR = "yuzu-windows-msvc-$GITDATE-$GITREV.tar" -replace " ", ""
  14. $MSVC_TARXZ = "yuzu-windows-msvc-$GITDATE-$GITREV.tar.xz" -replace " ", ""
  15. $MSVC_SOURCE = "yuzu-windows-msvc-source-$GITDATE-$GITREV" -replace " ", ""
  16. $MSVC_SOURCE_TAR = "$MSVC_SOURCE.tar"
  17. $MSVC_SOURCE_TARXZ = "$MSVC_SOURCE_TAR.xz"
  18. $env:BUILD_ZIP = $MSVC_BUILD_ZIP
  19. $env:BUILD_SYMBOLS = $MSVC_BUILD_PDB
  20. $env:BUILD_UPDATE = $MSVC_SEVENZIP
  21. $BUILD_DIR = ".\build\bin\Release"
  22. # Cleanup unneeded data in submodules
  23. git submodule foreach git clean -fxd
  24. # Upload debugging symbols
  25. mkdir pdb
  26. Get-ChildItem "$BUILD_DIR\" -Recurse -Filter "*.pdb" | Copy-Item -destination .\pdb
  27. 7z a -tzip $MSVC_BUILD_PDB .\pdb\*.pdb
  28. rm "$BUILD_DIR\*.pdb"
  29. # Create artifact directories
  30. mkdir $RELEASE_DIST
  31. mkdir $MSVC_SOURCE
  32. mkdir "artifacts"
  33. # Build a tar.xz for the source of the release
  34. Copy-Item .\license.txt -Destination $MSVC_SOURCE
  35. Copy-Item .\README.md -Destination $MSVC_SOURCE
  36. Copy-Item .\CMakeLists.txt -Destination $MSVC_SOURCE
  37. Copy-Item .\src -Recurse -Destination $MSVC_SOURCE
  38. Copy-Item .\externals -Recurse -Destination $MSVC_SOURCE
  39. Copy-Item .\dist -Recurse -Destination $MSVC_SOURCE
  40. Copy-Item .\CMakeModules -Recurse -Destination $MSVC_SOURCE
  41. 7z a -r -ttar $MSVC_SOURCE_TAR $MSVC_SOURCE
  42. 7z a -r -txz $MSVC_SOURCE_TARXZ $MSVC_SOURCE_TAR
  43. # Build the final release artifacts
  44. Copy-Item $MSVC_SOURCE_TARXZ -Destination $RELEASE_DIST
  45. Copy-Item "$BUILD_DIR\*" -Destination $RELEASE_DIST -Recurse
  46. rm "$RELEASE_DIST\*.exe"
  47. Get-ChildItem "$BUILD_DIR" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
  48. Get-ChildItem "$BUILD_DIR" -Recurse -Filter "QtWebEngineProcess*.exe" | Copy-Item -destination $RELEASE_DIST
  49. 7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\*
  50. 7z a $MSVC_SEVENZIP $RELEASE_DIST
  51. 7z a -r -ttar $MSVC_TAR $RELEASE_DIST
  52. 7z a -r -txz $MSVC_TARXZ $MSVC_TAR
  53. Get-ChildItem . -Filter "*.zip" | Copy-Item -destination "artifacts"
  54. Get-ChildItem . -Filter "*.7z" | Copy-Item -destination "artifacts"
  55. Get-ChildItem . -Filter "*.tar.xz" | Copy-Item -destination "artifacts"