upload.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash -ex
  2. # SPDX-FileCopyrightText: 2019 yuzu Emulator Project
  3. # SPDX-License-Identifier: GPL-2.0-or-later
  4. . .ci/scripts/common/pre-upload.sh
  5. APPIMAGE_NAME="yuzu-${RELEASE_NAME}-${GITDATE}-${GITREV}.AppImage"
  6. BASE_NAME="yuzu-linux"
  7. REV_NAME="${BASE_NAME}-${GITDATE}-${GITREV}"
  8. ARCHIVE_NAME="${REV_NAME}.tar.xz"
  9. COMPRESSION_FLAGS="-cJvf"
  10. if [ "${RELEASE_NAME}" = "mainline" ] || [ "${RELEASE_NAME}" = "early-access" ]; then
  11. DIR_NAME="${BASE_NAME}-${RELEASE_NAME}"
  12. else
  13. DIR_NAME="${REV_NAME}-${RELEASE_NAME}"
  14. fi
  15. mkdir "$DIR_NAME"
  16. cp build/bin/yuzu-cmd "$DIR_NAME"
  17. if [ "${RELEASE_NAME}" != "early-access" ] && [ "${RELEASE_NAME}" != "mainline" ]; then
  18. cp build/bin/yuzu "$DIR_NAME"
  19. fi
  20. # Build an AppImage
  21. cd build
  22. wget -nc https://gitlab.com/suyu-emu/ext-linux-bin/-/raw/main/appimage/appimagetool-x86_64.AppImage
  23. chmod 755 appimagetool-x86_64.AppImage
  24. # if FUSE is not available, then fallback to extract and run
  25. if ! ./appimagetool-x86_64.AppImage --version; then
  26. export APPIMAGE_EXTRACT_AND_RUN=1
  27. fi
  28. # Don't let AppImageLauncher ask to integrate EA
  29. if [ "${RELEASE_NAME}" = "mainline" ] || [ "${RELEASE_NAME}" = "early-access" ]; then
  30. echo "X-AppImage-Integrate=false" >> AppDir/org.suyu_emu.suyu.desktop
  31. fi
  32. if [ "${RELEASE_NAME}" = "mainline" ]; then
  33. # Generate update information if releasing to mainline
  34. ./appimagetool-x86_64.AppImage -u "gh-releases-zsync|yuzu-emu|yuzu-${RELEASE_NAME}|latest|yuzu-*.AppImage.zsync" AppDir "${APPIMAGE_NAME}"
  35. else
  36. ./appimagetool-x86_64.AppImage AppDir "${APPIMAGE_NAME}"
  37. fi
  38. cd ..
  39. # Copy the AppImage and update info to the artifacts directory and avoid compressing it
  40. cp "build/${APPIMAGE_NAME}" "${ARTIFACTS_DIR}/"
  41. if [ -f "build/${APPIMAGE_NAME}.zsync" ]; then
  42. cp "build/${APPIMAGE_NAME}.zsync" "${ARTIFACTS_DIR}/"
  43. fi
  44. # Copy the AppImage to the general release directory and remove git revision info
  45. if [ "${RELEASE_NAME}" = "mainline" ] || [ "${RELEASE_NAME}" = "early-access" ]; then
  46. cp "build/${APPIMAGE_NAME}" "${DIR_NAME}/yuzu-${RELEASE_NAME}.AppImage"
  47. fi
  48. # Copy debug symbols to artifacts
  49. cd build/bin
  50. tar $COMPRESSION_FLAGS "${ARTIFACTS_DIR}/${REV_NAME}-debug.tar.xz" *.debug
  51. cd -
  52. . .ci/scripts/common/post-upload.sh