upload.ps1 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 .\src -Recurse -Destination $MSVC_SOURCE
  35. Copy-Item .\externals -Recurse -Destination $MSVC_SOURCE
  36. Copy-Item .\dist -Recurse -Destination $MSVC_SOURCE
  37. Copy-Item .\CMakeModules -Recurse -Destination $MSVC_SOURCE
  38. 7z a -r -ttar $MSVC_SOURCE_TAR $MSVC_SOURCE
  39. 7z a -r -txz $MSVC_SOURCE_TARXZ $MSVC_SOURCE_TAR
  40. # Build the final release artifacts
  41. Copy-Item $MSVC_SOURCE_TARXZ -Destination $RELEASE_DIST
  42. Copy-Item "$BUILD_DIR\*" -Destination $RELEASE_DIST -Recurse
  43. rm "$RELEASE_DIST\*.exe"
  44. Get-ChildItem "$BUILD_DIR" -Recurse -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
  45. Get-ChildItem "$BUILD_DIR" -Recurse -Filter "QtWebEngineProcess*.exe" | Copy-Item -destination $RELEASE_DIST
  46. 7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\*
  47. 7z a $MSVC_SEVENZIP $RELEASE_DIST
  48. 7z a -r -ttar $MSVC_TAR $RELEASE_DIST
  49. 7z a -r -txz $MSVC_TARXZ $MSVC_TAR
  50. Get-ChildItem . -Filter "*.zip" | Copy-Item -destination "artifacts"
  51. Get-ChildItem . -Filter "*.7z" | Copy-Item -destination "artifacts"
  52. Get-ChildItem . -Filter "*.tar.xz" | Copy-Item -destination "artifacts"