upload.ps1 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. # Upload debugging symbols
  23. mkdir pdb
  24. Get-ChildItem "$BUILD_DIR\" -Recurse -Filter "*.pdb" | Copy-Item -destination .\pdb
  25. 7z a -tzip $MSVC_BUILD_PDB .\pdb\*.pdb
  26. rm "$BUILD_DIR\*.pdb"
  27. # Create artifact directories
  28. mkdir $RELEASE_DIST
  29. mkdir $MSVC_SOURCE
  30. mkdir "artifacts"
  31. # Build a tar.xz for the source of the release
  32. Copy-Item .\license.txt -Destination $MSVC_SOURCE
  33. Copy-Item .\README.md -Destination $MSVC_SOURCE
  34. Copy-Item .\CMakeLists.txt -Destination $MSVC_SOURCE
  35. Copy-Item .\src -Recurse -Destination $MSVC_SOURCE
  36. Copy-Item .\externals -Recurse -Destination $MSVC_SOURCE
  37. Copy-Item .\dist -Recurse -Destination $MSVC_SOURCE
  38. Copy-Item .\CMakeModules -Recurse -Destination $MSVC_SOURCE
  39. 7z a -r -ttar $MSVC_SOURCE_TAR $MSVC_SOURCE
  40. 7z a -r -txz $MSVC_SOURCE_TARXZ $MSVC_SOURCE_TAR
  41. # Build the final release artifacts
  42. Copy-Item $MSVC_SOURCE_TARXZ -Destination $RELEASE_DIST
  43. Copy-Item "$BUILD_DIR\*" -Destination $RELEASE_DIST -Recurse
  44. rm "$RELEASE_DIST\*.exe"
  45. Get-ChildItem "$BUILD_DIR" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
  46. Get-ChildItem "$BUILD_DIR" -Recurse -Filter "QtWebEngineProcess*.exe" | Copy-Item -destination $RELEASE_DIST
  47. 7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\*
  48. 7z a $MSVC_SEVENZIP $RELEASE_DIST
  49. 7z a -r -ttar $MSVC_TAR $RELEASE_DIST
  50. 7z a -r -txz $MSVC_TARXZ $MSVC_TAR
  51. Get-ChildItem . -Filter "*.zip" | Copy-Item -destination "artifacts"
  52. Get-ChildItem . -Filter "*.7z" | Copy-Item -destination "artifacts"
  53. Get-ChildItem . -Filter "*.tar.xz" | Copy-Item -destination "artifacts"