From 4a78a2533f6650d2103e25b6a53e080f3d5748ca Mon Sep 17 00:00:00 2001 From: Crimson-Hawk Date: Tue, 5 Mar 2024 20:10:18 +0800 Subject: [PATCH] imported hiddenFiles from legacy On branch master Your branch is up to date with 'origin/master'. Changes to be committed: new file: hiddenFiles/.DS_Store new file: hiddenFiles/.ci/.DS_Store new file: hiddenFiles/.ci/scripts/android/build.sh new file: hiddenFiles/.ci/scripts/android/eabuild.sh new file: hiddenFiles/.ci/scripts/android/mainlinebuild.sh new file: hiddenFiles/.ci/scripts/android/upload.sh new file: hiddenFiles/.ci/scripts/clang/docker.sh new file: hiddenFiles/.ci/scripts/clang/exec.sh new file: hiddenFiles/.ci/scripts/clang/upload.sh new file: hiddenFiles/.ci/scripts/common/post-upload.sh new file: hiddenFiles/.ci/scripts/common/pre-upload.sh new file: hiddenFiles/.ci/scripts/format/docker.sh new file: hiddenFiles/.ci/scripts/format/exec.sh new file: hiddenFiles/.ci/scripts/format/script.sh new file: hiddenFiles/.ci/scripts/linux/docker.sh new file: hiddenFiles/.ci/scripts/linux/exec.sh new file: hiddenFiles/.ci/scripts/linux/upload.sh new file: hiddenFiles/.ci/scripts/merge/apply-patches-by-label-private.py new file: hiddenFiles/.ci/scripts/merge/apply-patches-by-label.py new file: hiddenFiles/.ci/scripts/merge/check-label-presence.py new file: hiddenFiles/.ci/scripts/merge/yuzubot-git-config.sh new file: hiddenFiles/.ci/scripts/transifex/docker.sh new file: hiddenFiles/.ci/scripts/windows/docker.sh new file: hiddenFiles/.ci/scripts/windows/exec.sh new file: hiddenFiles/.ci/scripts/windows/install-vulkan-sdk.ps1 new file: hiddenFiles/.ci/scripts/windows/scan_dll.py new file: hiddenFiles/.ci/scripts/windows/upload.ps1 new file: hiddenFiles/.ci/scripts/windows/upload.sh new file: hiddenFiles/.ci/templates/build-mock.yml new file: hiddenFiles/.ci/templates/build-msvc.yml new file: hiddenFiles/.ci/templates/build-single.yml new file: hiddenFiles/.ci/templates/build-standard.yml new file: hiddenFiles/.ci/templates/build-testing.yml new file: hiddenFiles/.ci/templates/format-check.yml new file: hiddenFiles/.ci/templates/merge-private.yml new file: hiddenFiles/.ci/templates/merge.yml new file: hiddenFiles/.ci/templates/mergebot-private.yml new file: hiddenFiles/.ci/templates/mergebot.yml new file: hiddenFiles/.ci/templates/release-download.yml new file: hiddenFiles/.ci/templates/release-github.yml new file: hiddenFiles/.ci/templates/release-private-tag.yml new file: hiddenFiles/.ci/templates/release-universal.yml new file: hiddenFiles/.ci/templates/retrieve-artifact-source.yml new file: hiddenFiles/.ci/templates/retrieve-master-source.yml new file: hiddenFiles/.ci/templates/sync-source.yml new file: hiddenFiles/.ci/yuzu-mainline-step1.yml new file: hiddenFiles/.ci/yuzu-mainline-step2.yml new file: hiddenFiles/.ci/yuzu-patreon-step1.yml new file: hiddenFiles/.ci/yuzu-patreon-step2.yml new file: hiddenFiles/.ci/yuzu-repo-sync.yml new file: hiddenFiles/.ci/yuzu-verify.yml new file: hiddenFiles/.codespellrc new file: hiddenFiles/.git-blame-ignore-revs new file: hiddenFiles/.gitattributes new file: hiddenFiles/.gitmodules new file: hiddenFiles/.reuse/dep5 --- hiddenFiles/.DS_Store | Bin 0 -> 6148 bytes hiddenFiles/.ci/.DS_Store | Bin 0 -> 6148 bytes hiddenFiles/.ci/scripts/android/build.sh | 29 ++++ hiddenFiles/.ci/scripts/android/eabuild.sh | 21 +++ .../.ci/scripts/android/mainlinebuild.sh | 21 +++ hiddenFiles/.ci/scripts/android/upload.sh | 22 +++ hiddenFiles/.ci/scripts/clang/docker.sh | 32 ++++ hiddenFiles/.ci/scripts/clang/exec.sh | 11 ++ hiddenFiles/.ci/scripts/clang/upload.sh | 23 +++ hiddenFiles/.ci/scripts/common/post-upload.sh | 20 +++ hiddenFiles/.ci/scripts/common/pre-upload.sh | 10 ++ hiddenFiles/.ci/scripts/format/docker.sh | 9 + hiddenFiles/.ci/scripts/format/exec.sh | 10 ++ hiddenFiles/.ci/scripts/format/script.sh | 37 ++++ hiddenFiles/.ci/scripts/linux/docker.sh | 79 +++++++++ hiddenFiles/.ci/scripts/linux/exec.sh | 16 ++ hiddenFiles/.ci/scripts/linux/upload.sh | 67 ++++++++ .../merge/apply-patches-by-label-private.py | 48 ++++++ .../scripts/merge/apply-patches-by-label.py | 38 +++++ .../.ci/scripts/merge/check-label-presence.py | 21 +++ .../.ci/scripts/merge/yuzubot-git-config.sh | 5 + hiddenFiles/.ci/scripts/transifex/docker.sh | 19 +++ hiddenFiles/.ci/scripts/windows/docker.sh | 66 +++++++ hiddenFiles/.ci/scripts/windows/exec.sh | 11 ++ .../scripts/windows/install-vulkan-sdk.ps1 | 33 ++++ hiddenFiles/.ci/scripts/windows/scan_dll.py | 109 ++++++++++++ hiddenFiles/.ci/scripts/windows/upload.ps1 | 118 +++++++++++++ hiddenFiles/.ci/scripts/windows/upload.sh | 22 +++ hiddenFiles/.ci/templates/build-mock.yml | 8 + hiddenFiles/.ci/templates/build-msvc.yml | 31 ++++ hiddenFiles/.ci/templates/build-single.yml | 26 +++ hiddenFiles/.ci/templates/build-standard.yml | 33 ++++ hiddenFiles/.ci/templates/build-testing.yml | 40 +++++ hiddenFiles/.ci/templates/format-check.yml | 17 ++ hiddenFiles/.ci/templates/merge-private.yml | 44 +++++ hiddenFiles/.ci/templates/merge.yml | 43 +++++ .../.ci/templates/mergebot-private.yml | 33 ++++ hiddenFiles/.ci/templates/mergebot.yml | 18 ++ .../.ci/templates/release-download.yml | 16 ++ hiddenFiles/.ci/templates/release-github.yml | 16 ++ .../.ci/templates/release-private-tag.yml | 12 ++ .../.ci/templates/release-universal.yml | 13 ++ .../templates/retrieve-artifact-source.yml | 19 +++ .../.ci/templates/retrieve-master-source.yml | 14 ++ hiddenFiles/.ci/templates/sync-source.yml | 10 ++ hiddenFiles/.ci/yuzu-mainline-step1.yml | 14 ++ hiddenFiles/.ci/yuzu-mainline-step2.yml | 64 +++++++ hiddenFiles/.ci/yuzu-patreon-step1.yml | 14 ++ hiddenFiles/.ci/yuzu-patreon-step2.yml | 59 +++++++ hiddenFiles/.ci/yuzu-repo-sync.yml | 22 +++ hiddenFiles/.ci/yuzu-verify.yml | 23 +++ hiddenFiles/.codespellrc | 6 + hiddenFiles/.git-blame-ignore-revs | 5 + hiddenFiles/.gitattributes | 7 + hiddenFiles/.gitmodules | 69 ++++++++ hiddenFiles/.reuse/dep5 | 161 ++++++++++++++++++ 56 files changed, 1734 insertions(+) create mode 100644 hiddenFiles/.DS_Store create mode 100644 hiddenFiles/.ci/.DS_Store create mode 100755 hiddenFiles/.ci/scripts/android/build.sh create mode 100644 hiddenFiles/.ci/scripts/android/eabuild.sh create mode 100644 hiddenFiles/.ci/scripts/android/mainlinebuild.sh create mode 100755 hiddenFiles/.ci/scripts/android/upload.sh create mode 100755 hiddenFiles/.ci/scripts/clang/docker.sh create mode 100644 hiddenFiles/.ci/scripts/clang/exec.sh create mode 100755 hiddenFiles/.ci/scripts/clang/upload.sh create mode 100644 hiddenFiles/.ci/scripts/common/post-upload.sh create mode 100644 hiddenFiles/.ci/scripts/common/pre-upload.sh create mode 100644 hiddenFiles/.ci/scripts/format/docker.sh create mode 100644 hiddenFiles/.ci/scripts/format/exec.sh create mode 100755 hiddenFiles/.ci/scripts/format/script.sh create mode 100755 hiddenFiles/.ci/scripts/linux/docker.sh create mode 100644 hiddenFiles/.ci/scripts/linux/exec.sh create mode 100755 hiddenFiles/.ci/scripts/linux/upload.sh create mode 100644 hiddenFiles/.ci/scripts/merge/apply-patches-by-label-private.py create mode 100644 hiddenFiles/.ci/scripts/merge/apply-patches-by-label.py create mode 100644 hiddenFiles/.ci/scripts/merge/check-label-presence.py create mode 100644 hiddenFiles/.ci/scripts/merge/yuzubot-git-config.sh create mode 100755 hiddenFiles/.ci/scripts/transifex/docker.sh create mode 100755 hiddenFiles/.ci/scripts/windows/docker.sh create mode 100644 hiddenFiles/.ci/scripts/windows/exec.sh create mode 100644 hiddenFiles/.ci/scripts/windows/install-vulkan-sdk.ps1 create mode 100644 hiddenFiles/.ci/scripts/windows/scan_dll.py create mode 100644 hiddenFiles/.ci/scripts/windows/upload.ps1 create mode 100755 hiddenFiles/.ci/scripts/windows/upload.sh create mode 100644 hiddenFiles/.ci/templates/build-mock.yml create mode 100644 hiddenFiles/.ci/templates/build-msvc.yml create mode 100644 hiddenFiles/.ci/templates/build-single.yml create mode 100644 hiddenFiles/.ci/templates/build-standard.yml create mode 100644 hiddenFiles/.ci/templates/build-testing.yml create mode 100644 hiddenFiles/.ci/templates/format-check.yml create mode 100644 hiddenFiles/.ci/templates/merge-private.yml create mode 100644 hiddenFiles/.ci/templates/merge.yml create mode 100644 hiddenFiles/.ci/templates/mergebot-private.yml create mode 100644 hiddenFiles/.ci/templates/mergebot.yml create mode 100644 hiddenFiles/.ci/templates/release-download.yml create mode 100644 hiddenFiles/.ci/templates/release-github.yml create mode 100644 hiddenFiles/.ci/templates/release-private-tag.yml create mode 100644 hiddenFiles/.ci/templates/release-universal.yml create mode 100644 hiddenFiles/.ci/templates/retrieve-artifact-source.yml create mode 100644 hiddenFiles/.ci/templates/retrieve-master-source.yml create mode 100644 hiddenFiles/.ci/templates/sync-source.yml create mode 100644 hiddenFiles/.ci/yuzu-mainline-step1.yml create mode 100644 hiddenFiles/.ci/yuzu-mainline-step2.yml create mode 100644 hiddenFiles/.ci/yuzu-patreon-step1.yml create mode 100644 hiddenFiles/.ci/yuzu-patreon-step2.yml create mode 100644 hiddenFiles/.ci/yuzu-repo-sync.yml create mode 100644 hiddenFiles/.ci/yuzu-verify.yml create mode 100644 hiddenFiles/.codespellrc create mode 100644 hiddenFiles/.git-blame-ignore-revs create mode 100644 hiddenFiles/.gitattributes create mode 100644 hiddenFiles/.gitmodules create mode 100644 hiddenFiles/.reuse/dep5 diff --git a/hiddenFiles/.DS_Store b/hiddenFiles/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8192d4dc7111bda0c6c9bf4ebe45b35819b296b9 GIT binary patch literal 6148 zcmeHKyH3L}6ul-DiqxeN3!`@=Q2)SG;S2f$s1E^Bqg0^o`3-)6g^dj{Gx0@ioa1ZS z7y=_gaIa(^=e~2K*s+MX$!0MY8Hq@VL3CX72-Ur&z2r=zV~+83-qh=!6u(!+-U~UF zxm>L-y8S;s>@0OtRkKwygQmP2zCPW)JfC*0i*Ky!%TCt9BTV*D?^>3!ksDd&RS)hz z+Pk%nPPVnP9Cfqn;47c34~c!S7ZYQ^7%&Emf&a$<&TL9KRJ7R`Fb0f)Ed$&iJO(i& zY!&0yfhk@AfCH$bV9mP(V|>DpuvLTw;xrVfp)Or9oQ6a1lV3>KDr&g6SQ&Xz<@d{r zi`Aj`(Oq0nwAmOi266@peH`)pKf@=}d&$p3?8z7~2L2cWZct6D30^9lt)E_xXRXIL s$Dq)!rqyDJ})X6NzY#2o*rJFCw*SaA9&R_vRZ65ew0av zSVdPZv>7 "${ANDROID_KEYSTORE_FILE}" +fi + +cd src/android +chmod +x ./gradlew +./gradlew "assemble${BUILD_FLAVOR}${BUILD_TYPE}" "bundle${BUILD_FLAVOR}${BUILD_TYPE}" + +ccache -s + +if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then + rm "${ANDROID_KEYSTORE_FILE}" +fi diff --git a/hiddenFiles/.ci/scripts/android/eabuild.sh b/hiddenFiles/.ci/scripts/android/eabuild.sh new file mode 100644 index 0000000000..1672f29489 --- /dev/null +++ b/hiddenFiles/.ci/scripts/android/eabuild.sh @@ -0,0 +1,21 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2024 yuzu Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +export NDK_CCACHE="$(which ccache)" +ccache -s + +export ANDROID_KEYSTORE_FILE="${GITHUB_WORKSPACE}/ks.jks" +base64 --decode <<< "${EA_PLAY_ANDROID_KEYSTORE_B64}" > "${ANDROID_KEYSTORE_FILE}" +export ANDROID_KEY_ALIAS="${PLAY_ANDROID_KEY_ALIAS}" +export ANDROID_KEYSTORE_PASS="${PLAY_ANDROID_KEYSTORE_PASS}" +export SERVICE_ACCOUNT_KEY_PATH="${GITHUB_WORKSPACE}/sa.json" +base64 --decode <<< "${EA_SERVICE_ACCOUNT_KEY_B64}" > "${SERVICE_ACCOUNT_KEY_PATH}" +./gradlew "publishEaReleaseBundle" + +ccache -s + +if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then + rm "${ANDROID_KEYSTORE_FILE}" +fi diff --git a/hiddenFiles/.ci/scripts/android/mainlinebuild.sh b/hiddenFiles/.ci/scripts/android/mainlinebuild.sh new file mode 100644 index 0000000000..f3b89ed1c1 --- /dev/null +++ b/hiddenFiles/.ci/scripts/android/mainlinebuild.sh @@ -0,0 +1,21 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2024 yuzu Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +export NDK_CCACHE="$(which ccache)" +ccache -s + +export ANDROID_KEYSTORE_FILE="${GITHUB_WORKSPACE}/ks.jks" +base64 --decode <<< "${MAINLINE_PLAY_ANDROID_KEYSTORE_B64}" > "${ANDROID_KEYSTORE_FILE}" +export ANDROID_KEY_ALIAS="${PLAY_ANDROID_KEY_ALIAS}" +export ANDROID_KEYSTORE_PASS="${PLAY_ANDROID_KEYSTORE_PASS}" +export SERVICE_ACCOUNT_KEY_PATH="${GITHUB_WORKSPACE}/sa.json" +base64 --decode <<< "${MAINLINE_SERVICE_ACCOUNT_KEY_B64}" > "${SERVICE_ACCOUNT_KEY_PATH}" +./gradlew "publishMainlineReleaseBundle" + +ccache -s + +if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then + rm "${ANDROID_KEYSTORE_FILE}" +fi diff --git a/hiddenFiles/.ci/scripts/android/upload.sh b/hiddenFiles/.ci/scripts/android/upload.sh new file mode 100755 index 0000000000..26b1a7efa2 --- /dev/null +++ b/hiddenFiles/.ci/scripts/android/upload.sh @@ -0,0 +1,22 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2023 yuzu Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later + +. ./.ci/scripts/common/pre-upload.sh + +REV_NAME="yuzu-${GITDATE}-${GITREV}" + +BUILD_FLAVOR="mainline" + +BUILD_TYPE_LOWER="release" +BUILD_TYPE_UPPER="Release" +if [ "${GITHUB_REPOSITORY}" == "yuzu-emu/yuzu" ]; then + BUILD_TYPE_LOWER="relWithDebInfo" + BUILD_TYPE_UPPER="RelWithDebInfo" +fi + +cp src/android/app/build/outputs/apk/"${BUILD_FLAVOR}/${BUILD_TYPE_LOWER}/app-${BUILD_FLAVOR}-${BUILD_TYPE_LOWER}.apk" \ + "artifacts/${REV_NAME}.apk" +cp src/android/app/build/outputs/bundle/"${BUILD_FLAVOR}${BUILD_TYPE_UPPER}"/"app-${BUILD_FLAVOR}-${BUILD_TYPE_LOWER}.aab" \ + "artifacts/${REV_NAME}.aab" diff --git a/hiddenFiles/.ci/scripts/clang/docker.sh b/hiddenFiles/.ci/scripts/clang/docker.sh new file mode 100755 index 0000000000..f878e24e15 --- /dev/null +++ b/hiddenFiles/.ci/scripts/clang/docker.sh @@ -0,0 +1,32 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2021 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +# Exit on error, rather than continuing with the rest of the script. +set -e + +ccache -s + +mkdir build || true && cd build +cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ + -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \ + -DCMAKE_C_COMPILER=/usr/lib/ccache/clang \ + -DCMAKE_INSTALL_PREFIX="/usr" \ + -DDISPLAY_VERSION=$1 \ + -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ + -DENABLE_QT_TRANSLATION=ON \ + -DUSE_DISCORD_PRESENCE=ON \ + -DYUZU_CRASH_DUMPS=ON \ + -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \ + -DYUZU_USE_BUNDLED_FFMPEG=ON \ + -GNinja + +ninja + +ccache -s + +ctest -VV -C Release + diff --git a/hiddenFiles/.ci/scripts/clang/exec.sh b/hiddenFiles/.ci/scripts/clang/exec.sh new file mode 100644 index 0000000000..664fce5f84 --- /dev/null +++ b/hiddenFiles/.ci/scripts/clang/exec.sh @@ -0,0 +1,11 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2021 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +mkdir -p "ccache" || true +chmod a+x ./.ci/scripts/clang/docker.sh +# the UID for the container yuzu user is 1027 +sudo chown -R 1027 ./ +docker run -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v "$(pwd):/yuzu" -w /yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/clang/docker.sh "$1" +sudo chown -R $UID ./ diff --git a/hiddenFiles/.ci/scripts/clang/upload.sh b/hiddenFiles/.ci/scripts/clang/upload.sh new file mode 100755 index 0000000000..0b4b3e330b --- /dev/null +++ b/hiddenFiles/.ci/scripts/clang/upload.sh @@ -0,0 +1,23 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2021 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +. .ci/scripts/common/pre-upload.sh + +REV_NAME="yuzu-linux-${GITDATE}-${GITREV}" +ARCHIVE_NAME="${REV_NAME}.tar.xz" +COMPRESSION_FLAGS="-cJvf" + +if [ "${RELEASE_NAME}" = "mainline" ]; then + DIR_NAME="${REV_NAME}" +else + DIR_NAME="${REV_NAME}_${RELEASE_NAME}" +fi + +mkdir "$DIR_NAME" + +cp build/bin/yuzu-cmd "$DIR_NAME" +cp build/bin/yuzu "$DIR_NAME" + +. .ci/scripts/common/post-upload.sh diff --git a/hiddenFiles/.ci/scripts/common/post-upload.sh b/hiddenFiles/.ci/scripts/common/post-upload.sh new file mode 100644 index 0000000000..0930b7a7bd --- /dev/null +++ b/hiddenFiles/.ci/scripts/common/post-upload.sh @@ -0,0 +1,20 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +# Copy documentation +cp LICENSE.txt "$DIR_NAME" +cp README.md "$DIR_NAME" + +if [[ -z "${NO_SOURCE_PACK}" ]]; then + git clone --depth 1 file://$(readlink -e .) ${REV_NAME}-source + tar -cJvf "${REV_NAME}-source.tar.xz" ${REV_NAME}-source + cp -v "${REV_NAME}-source.tar.xz" "$DIR_NAME" + cp -v "${REV_NAME}-source.tar.xz" "${ARTIFACTS_DIR}/" +fi + +tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$DIR_NAME" + +# move the compiled archive into the artifacts directory to be uploaded by travis releases +mv "$ARCHIVE_NAME" "${ARTIFACTS_DIR}/" diff --git a/hiddenFiles/.ci/scripts/common/pre-upload.sh b/hiddenFiles/.ci/scripts/common/pre-upload.sh new file mode 100644 index 0000000000..3583f98402 --- /dev/null +++ b/hiddenFiles/.ci/scripts/common/pre-upload.sh @@ -0,0 +1,10 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" +GITREV="`git show -s --format='%h'`" +ARTIFACTS_DIR="$PWD/artifacts" + +mkdir -p "${ARTIFACTS_DIR}/" diff --git a/hiddenFiles/.ci/scripts/format/docker.sh b/hiddenFiles/.ci/scripts/format/docker.sh new file mode 100644 index 0000000000..a0f7a61cce --- /dev/null +++ b/hiddenFiles/.ci/scripts/format/docker.sh @@ -0,0 +1,9 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +# Run clang-format +cd /yuzu +chmod a+x ./.ci/scripts/format/script.sh +./.ci/scripts/format/script.sh diff --git a/hiddenFiles/.ci/scripts/format/exec.sh b/hiddenFiles/.ci/scripts/format/exec.sh new file mode 100644 index 0000000000..40ab41abda --- /dev/null +++ b/hiddenFiles/.ci/scripts/format/exec.sh @@ -0,0 +1,10 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +chmod a+x ./.ci/scripts/format/docker.sh +# the UID for the container yuzu user is 1027 +sudo chown -R 1027 ./ +docker run -v "$(pwd):/yuzu" -w /yuzu yuzuemu/build-environments:linux-clang-format /bin/bash -ex /yuzu/.ci/scripts/format/docker.sh +sudo chown -R $UID ./ diff --git a/hiddenFiles/.ci/scripts/format/script.sh b/hiddenFiles/.ci/scripts/format/script.sh new file mode 100755 index 0000000000..f9c63dbfa3 --- /dev/null +++ b/hiddenFiles/.ci/scripts/format/script.sh @@ -0,0 +1,37 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +shopt -s nullglob globstar + +if git grep -nrI '\s$' src **/*.yml **/*.txt **/*.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop dist/*.svg dist/*.xml; then + echo Trailing whitespace found, aborting + exit 1 +fi + +# Default clang-format points to default 3.5 version one +CLANG_FORMAT="${CLANG_FORMAT:-clang-format-15}" +"$CLANG_FORMAT" --version + +# Turn off tracing for this because it's too verbose +set +x + +# Check everything for branch pushes +FILES_TO_LINT="$(find src/ -name '*.cpp' -or -name '*.h')" + +for f in $FILES_TO_LINT; do + echo "$f" + "$CLANG_FORMAT" -i "$f" +done + +DIFF=$(git -c core.fileMode=false diff) + +if [ ! -z "$DIFF" ]; then + echo "!!! Not compliant to coding style, here is the fix:" + echo "$DIFF" + exit 1 +fi + +cd src/android +./gradlew ktlintCheck diff --git a/hiddenFiles/.ci/scripts/linux/docker.sh b/hiddenFiles/.ci/scripts/linux/docker.sh new file mode 100755 index 0000000000..7bba01d62a --- /dev/null +++ b/hiddenFiles/.ci/scripts/linux/docker.sh @@ -0,0 +1,79 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +# Exit on error, rather than continuing with the rest of the script. +set -e + +ccache -s + +mkdir build || true && cd build +cmake .. \ + -DBoost_USE_STATIC_LIBS=ON \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_CXX_FLAGS="-march=x86-64-v2" \ + -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \ + -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \ + -DCMAKE_INSTALL_PREFIX="/usr" \ + -DDISPLAY_VERSION=$1 \ + -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ + -DENABLE_QT_TRANSLATION=ON \ + -DUSE_DISCORD_PRESENCE=ON \ + -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \ + -DYUZU_USE_BUNDLED_FFMPEG=ON \ + -DYUZU_ENABLE_LTO=ON \ + -DYUZU_CRASH_DUMPS=ON \ + -GNinja + +ninja + +ccache -s + +ctest -VV -C Release + +# Separate debug symbols from specified executables +for EXE in yuzu; do + EXE_PATH="bin/$EXE" + # Copy debug symbols out + objcopy --only-keep-debug $EXE_PATH $EXE_PATH.debug + # Add debug link and strip debug symbols + objcopy -g --add-gnu-debuglink=$EXE_PATH.debug $EXE_PATH $EXE_PATH.out + # Overwrite original with stripped copy + mv $EXE_PATH.out $EXE_PATH +done +# Strip debug symbols from all executables +find bin/ -type f -not -regex '.*.debug' -exec strip -g {} ';' + +DESTDIR="$PWD/AppDir" ninja install +rm -vf AppDir/usr/bin/yuzu-cmd AppDir/usr/bin/yuzu-tester + +# Download tools needed to build an AppImage +wget -nc https://raw.githubusercontent.com/yuzu-emu/ext-linux-bin/main/appimage/deploy-linux.sh +wget -nc https://raw.githubusercontent.com/yuzu-emu/AppImageKit-checkrt/old/AppRun.sh +wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/exec-x86_64.so +# Set executable bit +chmod 755 \ + deploy-linux.sh \ + AppRun.sh \ + exec-x86_64.so \ + +# Workaround for https://github.com/AppImage/AppImageKit/issues/828 +export APPIMAGE_EXTRACT_AND_RUN=1 + +mkdir -p AppDir/usr/optional +mkdir -p AppDir/usr/optional/libstdc++ +mkdir -p AppDir/usr/optional/libgcc_s + +# Deploy yuzu's needed dependencies +DEPLOY_QT=1 ./deploy-linux.sh AppDir/usr/bin/yuzu AppDir + +# Workaround for libQt5MultimediaGstTools indirectly requiring libwayland-client and breaking Vulkan usage on end-user systems +find AppDir -type f -regex '.*libwayland-client\.so.*' -delete -print + +# Workaround for building yuzu with GCC 10 but also trying to distribute it to Ubuntu 18.04 et al. +# See https://github.com/darealshinji/AppImageKit-checkrt +cp exec-x86_64.so AppDir/usr/optional/exec.so +cp AppRun.sh AppDir/AppRun +cp --dereference /usr/lib/x86_64-linux-gnu/libstdc++.so.6 AppDir/usr/optional/libstdc++/libstdc++.so.6 +cp --dereference /lib/x86_64-linux-gnu/libgcc_s.so.1 AppDir/usr/optional/libgcc_s/libgcc_s.so.1 diff --git a/hiddenFiles/.ci/scripts/linux/exec.sh b/hiddenFiles/.ci/scripts/linux/exec.sh new file mode 100644 index 0000000000..04e2486a1b --- /dev/null +++ b/hiddenFiles/.ci/scripts/linux/exec.sh @@ -0,0 +1,16 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +mkdir -p "ccache" || true +chmod a+x ./.ci/scripts/linux/docker.sh +# the UID for the container yuzu user is 1027 +sudo chown -R 1027 ./ + +# The environment variables listed below: +# AZURECIREPO TITLEBARFORMATIDLE TITLEBARFORMATRUNNING DISPLAYVERSION +# are requested in src/common/CMakeLists.txt and appear to be provided somewhere in Azure DevOps + +docker run -e AZURECIREPO -e TITLEBARFORMATIDLE -e TITLEBARFORMATRUNNING -e DISPLAYVERSION -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v "$(pwd):/yuzu" -w /yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/linux/docker.sh "$1" +sudo chown -R $UID ./ diff --git a/hiddenFiles/.ci/scripts/linux/upload.sh b/hiddenFiles/.ci/scripts/linux/upload.sh new file mode 100755 index 0000000000..fbb2d9c1b0 --- /dev/null +++ b/hiddenFiles/.ci/scripts/linux/upload.sh @@ -0,0 +1,67 @@ +#!/bin/bash -ex + +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +. .ci/scripts/common/pre-upload.sh + +APPIMAGE_NAME="yuzu-${RELEASE_NAME}-${GITDATE}-${GITREV}.AppImage" +BASE_NAME="yuzu-linux" +REV_NAME="${BASE_NAME}-${GITDATE}-${GITREV}" +ARCHIVE_NAME="${REV_NAME}.tar.xz" +COMPRESSION_FLAGS="-cJvf" + +if [ "${RELEASE_NAME}" = "mainline" ] || [ "${RELEASE_NAME}" = "early-access" ]; then + DIR_NAME="${BASE_NAME}-${RELEASE_NAME}" +else + DIR_NAME="${REV_NAME}-${RELEASE_NAME}" +fi + +mkdir "$DIR_NAME" + +cp build/bin/yuzu-cmd "$DIR_NAME" +if [ "${RELEASE_NAME}" != "early-access" ] && [ "${RELEASE_NAME}" != "mainline" ]; then + cp build/bin/yuzu "$DIR_NAME" +fi + +# Build an AppImage +cd build + +wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/appimagetool-x86_64.AppImage +chmod 755 appimagetool-x86_64.AppImage + +# if FUSE is not available, then fallback to extract and run +if ! ./appimagetool-x86_64.AppImage --version; then + export APPIMAGE_EXTRACT_AND_RUN=1 +fi + +# Don't let AppImageLauncher ask to integrate EA +if [ "${RELEASE_NAME}" = "mainline" ] || [ "${RELEASE_NAME}" = "early-access" ]; then + echo "X-AppImage-Integrate=false" >> AppDir/org.yuzu_emu.yuzu.desktop +fi + +if [ "${RELEASE_NAME}" = "mainline" ]; then + # Generate update information if releasing to mainline + ./appimagetool-x86_64.AppImage -u "gh-releases-zsync|yuzu-emu|yuzu-${RELEASE_NAME}|latest|yuzu-*.AppImage.zsync" AppDir "${APPIMAGE_NAME}" +else + ./appimagetool-x86_64.AppImage AppDir "${APPIMAGE_NAME}" +fi +cd .. + +# Copy the AppImage and update info to the artifacts directory and avoid compressing it +cp "build/${APPIMAGE_NAME}" "${ARTIFACTS_DIR}/" +if [ -f "build/${APPIMAGE_NAME}.zsync" ]; then + cp "build/${APPIMAGE_NAME}.zsync" "${ARTIFACTS_DIR}/" +fi + +# Copy the AppImage to the general release directory and remove git revision info +if [ "${RELEASE_NAME}" = "mainline" ] || [ "${RELEASE_NAME}" = "early-access" ]; then + cp "build/${APPIMAGE_NAME}" "${DIR_NAME}/yuzu-${RELEASE_NAME}.AppImage" +fi + +# Copy debug symbols to artifacts +cd build/bin +tar $COMPRESSION_FLAGS "${ARTIFACTS_DIR}/${REV_NAME}-debug.tar.xz" *.debug +cd - + +. .ci/scripts/common/post-upload.sh diff --git a/hiddenFiles/.ci/scripts/merge/apply-patches-by-label-private.py b/hiddenFiles/.ci/scripts/merge/apply-patches-by-label-private.py new file mode 100644 index 0000000000..c640c4c4da --- /dev/null +++ b/hiddenFiles/.ci/scripts/merge/apply-patches-by-label-private.py @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: 2019 yuzu Emulator Project +# SPDX-License-Identifier: GPL-2.0-or-later + +# Download all pull requests as patches that match a specific label +# Usage: python download-patches-by-label.py