diff --git a/.ci/scripts/android/build.sh b/.ci/scripts/android/build.sh index 98593017f..d0cfa8c56 100755 --- a/.ci/scripts/android/build.sh +++ b/.ci/scripts/android/build.sh @@ -6,7 +6,7 @@ export NDK_CCACHE="$(which ccache)" ccache -s -BUILD_FLAVOR="mainline" +BUILD_FLAVOR="ea" BUILD_TYPE="release" if [ "${GITHUB_REPOSITORY}" == "yuzu-emu/yuzu" ]; then @@ -15,7 +15,11 @@ fi if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then export ANDROID_KEYSTORE_FILE="${GITHUB_WORKSPACE}/ks.jks" - base64 --decode <<< "${ANDROID_KEYSTORE_B64}" > "${ANDROID_KEYSTORE_FILE}" + 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}" fi cd src/android diff --git a/.ci/scripts/android/eabuild.sh b/.ci/scripts/android/eabuild.sh index 1672f2948..d0cfa8c56 100644 --- a/.ci/scripts/android/eabuild.sh +++ b/.ci/scripts/android/eabuild.sh @@ -1,18 +1,30 @@ #!/bin/bash -ex -# SPDX-FileCopyrightText: 2024 yuzu Emulator Project +# SPDX-FileCopyrightText: 2023 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" +BUILD_FLAVOR="ea" + +BUILD_TYPE="release" +if [ "${GITHUB_REPOSITORY}" == "yuzu-emu/yuzu" ]; then + BUILD_TYPE="relWithDebInfo" +fi + +if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then + 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}" +fi + +cd src/android +chmod +x ./gradlew +./gradlew "assemble${BUILD_FLAVOR}${BUILD_TYPE}" "bundle${BUILD_FLAVOR}${BUILD_TYPE}" ccache -s diff --git a/.ci/scripts/android/upload.sh b/.ci/scripts/android/upload.sh index 26b1a7efa..736bc3b17 100755 --- a/.ci/scripts/android/upload.sh +++ b/.ci/scripts/android/upload.sh @@ -7,7 +7,7 @@ REV_NAME="yuzu-${GITDATE}-${GITREV}" -BUILD_FLAVOR="mainline" +BUILD_FLAVOR="ea" BUILD_TYPE_LOWER="release" BUILD_TYPE_UPPER="Release" diff --git a/.github/workflows/android-ea-play-release.yml b/.github/workflows/android-ea-play-release.yml index 0cf78279c..9635cf070 100644 --- a/.github/workflows/android-ea-play-release.yml +++ b/.github/workflows/android-ea-play-release.yml @@ -5,18 +5,13 @@ name: yuzu-android-ea-play-release on: workflow_dispatch: - inputs: - release-track: - description: 'Play store release track (internal/alpha/beta/production)' - required: true - default: 'alpha' jobs: android: runs-on: ubuntu-latest if: ${{ github.repository == 'yuzu-emu/yuzu' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Checkout with: fetch-depth: 0 @@ -37,7 +32,7 @@ jobs: - name: Get tag name run: echo "GIT_TAG_NAME=$(cat tag-name.txt)" >> $GITHUB_ENV - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' @@ -46,7 +41,8 @@ jobs: sudo apt-get update sudo apt-get install -y ccache apksigner glslang-dev glslang-tools - name: Build - run: ./.ci/scripts/android/eabuild.sh + run: ./.ci/scripts/android/build.sh + - name: Copy and sign artifacts env: EA_PLAY_ANDROID_KEYSTORE_B64: ${{ secrets.PLAY_ANDROID_KEYSTORE_B64 }} PLAY_ANDROID_KEY_ALIAS: ${{ secrets.PLAY_ANDROID_KEY_ALIAS }} @@ -55,12 +51,9 @@ jobs: STORE_TRACK: ${{ github.event.inputs.release-track }} AUTO_VERSIONED: true BUILD_EA: true - - name: Create release - uses: softprops/action-gh-release@v1 + run: ./.ci/scripts/android/upload.sh + - name: Upload + uses: actions/upload-artifact@v4 with: - tag_name: ${{ env.EA_TAG_NAME }} - name: ${{ env.EA_TAG_NAME }} - draft: false - prerelease: false - repository: yuzu/yuzu-android - token: ${{ secrets.ALT_GITHUB_TOKEN }} + name: earelease + path: artifacts/ diff --git a/.github/workflows/android-mainline-play-release.yml b/.github/workflows/android-mainline-play-release.yml index 8255e0a40..64824680d 100644 --- a/.github/workflows/android-mainline-play-release.yml +++ b/.github/workflows/android-mainline-play-release.yml @@ -5,22 +5,13 @@ name: yuzu-android-mainline-play-release on: workflow_dispatch: - inputs: - release-tag: - description: 'Tag # from yuzu-android that you want to build and publish' - required: true - default: '200' - release-track: - description: 'Play store release track (internal/alpha/beta/production)' - required: true - default: 'alpha' jobs: android: runs-on: ubuntu-latest if: ${{ github.repository == 'yuzu-emu/yuzu' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Checkout with: fetch-depth: 0 @@ -38,7 +29,7 @@ jobs: process.chdir('${{ github.workspace }}'); mergebot(execa); - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' @@ -50,6 +41,7 @@ jobs: run: | echo "GIT_TAG_NAME=android-${{ github.event.inputs.releast-tag }}" >> $GITHUB_ENV ./.ci/scripts/android/mainlinebuild.sh + - name: Copy and sign artifacts env: MAINLINE_PLAY_ANDROID_KEYSTORE_B64: ${{ secrets.PLAY_ANDROID_KEYSTORE_B64 }} PLAY_ANDROID_KEY_ALIAS: ${{ secrets.PLAY_ANDROID_KEY_ALIAS }} @@ -57,3 +49,9 @@ jobs: SERVICE_ACCOUNT_KEY_B64: ${{ secrets.MAINLINE_SERVICE_ACCOUNT_KEY_B64 }} STORE_TRACK: ${{ github.event.inputs.release-track }} AUTO_VERSIONED: true + run: ./.ci/scripts/android/upload.sh + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: mainline + path: artifacts/ \ No newline at end of file diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 13bde68c3..84649da23 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -14,154 +14,31 @@ jobs: name: 'verify format' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: false - name: set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - name: 'Verify Formatting' run: bash -ex ./.ci/scripts/format/script.sh - build: - name: 'test build' - needs: format - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - type: clang - image: linux-fresh - - type: linux - image: linux-fresh - - type: windows - image: linux-mingw - container: - image: yuzuemu/build-environments:${{ matrix.image }} - options: -u 1001 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - name: Set up cache - uses: actions/cache@v3 - id: ccache-restore - with: - path: ~/.ccache - key: ${{ runner.os }}-${{ matrix.type }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-${{ matrix.type }}- - - name: Create ccache directory - if: steps.ccache-restore.outputs.cache-hit != 'true' - run: mkdir -p ~/.ccache - - name: Build - run: ./.ci/scripts/${{ matrix.type }}/docker.sh - env: - ENABLE_COMPATIBILITY_REPORTING: "ON" - - name: Pack - run: ./.ci/scripts/${{ matrix.type }}/upload.sh - env: - NO_SOURCE_PACK: "YES" - - name: Upload - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.type }} - path: artifacts/ - build-mac: - name: 'test build (macos)' - needs: format - runs-on: macos-14 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - name: Install dependencies - run: | - brew install autoconf automake boost ccache ffmpeg fmt glslang hidapi libtool libusb lz4 ninja nlohmann-json openssl pkg-config qt@5 sdl2 speexdsp zlib zlib zstd - - name: Build - run: | - mkdir build - cd build - export Qt5_DIR="$(brew --prefix qt@5)/lib/cmake" - cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF - ninja - build-msvc: - name: 'test build (windows, msvc)' - needs: format - runs-on: windows-2022 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - name: Set up cache - uses: actions/cache@v3 - with: - path: ~/.buildcache - key: ${{ runner.os }}-msvc-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-msvc- - - name: Install dependencies - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - $BuildCacheVer = "v0.28.4" - $File = "buildcache-windows.zip" - $Uri = "https://github.com/mbitsnbites/buildcache/releases/download/$BuildCacheVer/$File" - $WebClient = New-Object System.Net.WebClient - $WebClient.DownloadFile($Uri, $File) - 7z x $File - $CurrentDir = Convert-Path . - echo "$CurrentDir/buildcache/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Install Vulkan SDK - shell: pwsh - run: .\.ci\scripts\windows\install-vulkan-sdk.ps1 - - name: Set up MSVC - uses: ilammy/msvc-dev-cmd@v1 - - name: Configure - env: - CC: cl.exe - CXX: cl.exe - run: | - glslangValidator --version - mkdir build - cmake . -B build -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DGIT_BRANCH=pr-verify -DYUZU_CRASH_DUMPS=ON - - name: Build - run: cmake --build build - - name: Cache Summary - run: buildcache -s - - name: Pack - shell: pwsh - run: .\.ci\scripts\windows\upload.ps1 - - name: Upload - uses: actions/upload-artifact@v3 - with: - name: msvc - path: artifacts/ - - name: Upload EXE - uses: actions/upload-artifact@v3 - with: - name: ${{ env.INDIVIDUAL_EXE }} - path: ${{ env.INDIVIDUAL_EXE }} - android: + earelease: runs-on: ubuntu-latest needs: format steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - name: Set up cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.gradle/caches @@ -181,12 +58,13 @@ jobs: run: ./.ci/scripts/android/build.sh - name: Copy and sign artifacts env: - ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }} - ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} - ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }} + EA_PLAY_ANDROID_KEYSTORE_B64: ${{ secrets.PLAY_ANDROID_KEYSTORE_B64 }} + PLAY_ANDROID_KEY_ALIAS: ${{ secrets.PLAY_ANDROID_KEY_ALIAS }} + PLAY_ANDROID_KEYSTORE_PASS: ${{ secrets.PLAY_ANDROID_KEYSTORE_PASS }} + EA_SERVICE_ACCOUNT_KEY_B64: ${{ secrets.EA_SERVICE_ACCOUNT_KEY_B64 }} run: ./.ci/scripts/android/upload.sh - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: android + name: earelease path: artifacts/