chore: merge main into feat/lse-emu

This commit is contained in:
Kurt Himebauch committed 2026-11-15 13:30:28 -05:00
commit 73104aff03
667 files changed
+75245 -4143

No files matched your search

+64 -7
View File
@@ -127,6 +127,7 @@ jobs:
name: xbox-arm64
path: app/src/main/assets/linuxfs/usr/local/lib/droiddeck-xbox
retention-days: 14
overwrite: true
- uses: actions/upload-artifact@v4
with:
name: xbox-corresponding-source
@@ -135,6 +136,7 @@ jobs:
app/build/xbox/runtime/*-source.tar.xz
if-no-files-found: error
retention-days: 14
overwrite: true
components-runner:
needs: source
@@ -195,6 +197,7 @@ jobs:
!app/src/main/assets/linuxfs/i386/libfaultreport.so
!app/src/main/assets/linuxfs/libblaudit.so
!app/src/main/assets/linuxfs/libblfastpath.so
!app/src/main/assets/linuxfs/libddnatv-hook.so
!app/src/main/assets/linuxfs/libblsession.so
!app/src/main/assets/linuxfs/libfakeinput.so
!app/src/main/assets/linuxfs/libssbs.so
@@ -332,6 +335,7 @@ jobs:
if-no-files-found: error
compression-level: 0
retention-days: 14
overwrite: true
build-runner:
needs: [components]
@@ -564,6 +568,12 @@ jobs:
command -v x86_64-w64-mingw32-gcc >/dev/null || { sudo apt-get update -qq && sudo apt-get install -y -qq gcc-mingw-w64-x86-64; }
bash tools/ubisoft-launcher/build.sh
- name: Rockstar launcher service (32-bit and 64-bit)
run: |
set -euo pipefail
command -v i686-w64-mingw32-gcc >/dev/null || { sudo apt-get update -qq && sudo apt-get install -y -qq gcc-mingw-w64-i686; }
bash tools/rockstar-launcher/build.sh
- uses: actions/download-artifact@v4
with:
name: xbox-arm64
@@ -619,12 +629,11 @@ jobs:
- name: Check out MaliBridge
run: git submodule update --init external/MaliBridge
- name: Fetch the Mali (Venus) component (tools/venus/release.env)
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
. tools/venus/release.env
gh release download "${VENUS_TAG}" -R "${VENUS_REPO}" -p venus.tzst -O venus.tzst
curl -fsSL --retry 5 --retry-all-errors --retry-delay 10 -o venus.tzst \
"https://github.com/${VENUS_REPO}/releases/download/${VENUS_TAG}/venus.tzst"
echo "${VENUS_SHA256} venus.tzst" | sha256sum -c -
tar --use-compress-program=unzstd -xf venus.tzst -C app/src/main
test -f app/src/main/jniLibs/arm64-v8a/libvirgl_test_server.so
@@ -661,6 +670,7 @@ jobs:
name: stores-cargo-lock
path: app/src/main/rust/stores/Cargo.lock
if-no-files-found: ignore
overwrite: true
- name: Unit tests
id: unit-tests
@@ -684,6 +694,7 @@ jobs:
app/build/reports/tests/testReleaseUnitTest/
if-no-files-found: ignore
retention-days: 14
overwrite: true
- name: Sign with the testkey (v1 + v2 + v3)
run: |
@@ -721,6 +732,7 @@ jobs:
if-no-files-found: error
retention-days: 30
compression-level: 0
overwrite: true
- uses: actions/upload-artifact@v4
with:
@@ -729,6 +741,7 @@ jobs:
if-no-files-found: error
retention-days: 30
compression-level: 0
overwrite: true
- name: Report on the pull request
if: always() && github.event_name == 'pull_request'
@@ -800,9 +813,11 @@ jobs:
set -o pipefail
cd app/src/main/rust/stores
cargo test --locked 2>&1 | tail -60
- name: Ubisoft launcher service host unit tests
- name: Windows launcher service host unit tests
timeout-minutes: 10
run: cargo test --locked --manifest-path tools/ubisoft-launcher/Cargo.toml
run: |
cargo test --locked --manifest-path tools/ubisoft-launcher/Cargo.toml
cargo test --locked --manifest-path tools/rockstar-launcher/Cargo.toml
python-tests:
name: Python and native regression tests
@@ -837,7 +852,7 @@ jobs:
run: test "$(git rev-parse 'HEAD^{tree}')" = "$XBOX_SOURCE_TREE"
- name: Install Python test dependencies
timeout-minutes: 7
run: bash tools/ci/install-ubuntu-packages.sh python3-yaml gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user libvulkan-dev mesa-vulkan-drivers
run: bash tools/ci/install-ubuntu-packages.sh python3-yaml gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user libvulkan-dev mesa-vulkan-drivers spirv-tools
- name: Resolve the pinned Android NDK
run: bash tools/ci/resolve-ndk.sh
@@ -867,6 +882,16 @@ jobs:
-ldl -o /tmp/test-presenter-shutdown
timeout 10 /tmp/test-presenter-shutdown
- name: Fetch the Mali compatibility layer's headers
run: |
set -euo pipefail
sdk=$(sed -n 's/^SDK=//p' tools/venus/ci-build.sh)
bcdec=$(grep -o 'https://raw.githubusercontent.com/iOrange/bcdec/[^ ]*' tools/venus/ci-build.sh)
mkdir -p build/layer-deps/bcdec
git -c advice.detachedHead=false clone -q --depth 1 -b "$sdk" https://github.com/KhronosGroup/Vulkan-Headers.git build/layer-deps/vulkan
git -c advice.detachedHead=false clone -q --depth 1 -b "$sdk" https://github.com/KhronosGroup/SPIRV-Headers.git build/layer-deps/spirv
curl -sSfL -o build/layer-deps/bcdec/bcdec.h "$bcdec"
- name: Steam import and game environment tests
run: bash tools/ci/run-python-tests.sh
@@ -925,7 +950,7 @@ jobs:
pull-requests: read
env:
CI_REPO: Droid-Deck/DroidDeck-CI
KEEP: 10
KEEP_DAYS: 14
steps:
- uses: actions/checkout@v4
with:
@@ -970,3 +995,35 @@ jobs:
if: ${{ always() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && needs.announce.result != 'skipped' }}
uses: ./.github/workflows/update-catalog.yml
secrets: inherit
retire-tests:
needs: catalog
if: ${{ always() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && needs.catalog.result == 'success' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
persist-credentials: false
- uses: actions/create-github-app-token@v2
id: ci-token
with:
app-id: ${{ vars.DROIDDECK_CI_APP_ID }}
private-key: ${{ secrets.DROIDDECK_CI_APP_KEY }}
owner: Droid-Deck
repositories: DroidDeck-CI
- name: Delete the test builds this Preview build replaces
env:
SOURCE_GITHUB_TOKEN: ${{ github.token }}
CI_GITHUB_TOKEN: ${{ steps.ci-token.outputs.token }}
run: python3 tools/release/retire_test_builds.py
catalog-after-retire:
needs: retire-tests
if: ${{ always() && needs.retire-tests.result == 'success' }}
uses: ./.github/workflows/update-catalog.yml
secrets: inherit
+141
View File
@@ -0,0 +1,141 @@
name: PR Rebuild On Version Bump
run-name: rebuild test builds below versionCode on main
on:
push:
branches: [main]
paths: [app/build.gradle]
workflow_dispatch:
permissions:
actions: write
contents: read
issues: write
pull-requests: read
concurrency:
group: pr-rebuild-on-version
cancel-in-progress: false
queue: max
jobs:
rebuild:
runs-on: ubuntu-24.04
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 2
persist-credentials: false
- name: Rebuild open PRs whose test build Android would refuse over main
env:
GH_TOKEN: ${{ github.token }}
EVENT_NAME: ${{ github.event_name }}
BEFORE: ${{ github.event.before }}
PUSHED_AT: ${{ github.event.repository.pushed_at }}
run: |
set -euo pipefail
code() { sed -n 's/^[[:space:]]*versionCode[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p'; }
now=$(code < app/build.gradle)
[[ "$now" =~ ^[0-9]+$ ]] || { echo "::error::No numeric versionCode on main"; exit 1; }
if [ "$EVENT_NAME" = push ]; then
was=$(git show "$BEFORE:app/build.gradle" 2>/dev/null | code || true)
if [[ "$was" =~ ^[0-9]+$ ]] && [ "$was" -ge "$now" ]; then
echo "versionCode stayed at $now"
exit 0
fi
fi
# This run is created right after the push, so a PR build that started earlier may have pinned the old main.
bumped=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" --jq .created_at)
# A build can finish between the push and this run's creation; the push event carries the push time.
if [[ "${PUSHED_AT:-}" =~ ^[0-9]+$ ]]; then
pushed=$(date -u -d "@$PUSHED_AT" +%Y-%m-%dT%H:%M:%SZ)
[[ "$pushed" < "$bumped" ]] && bumped=$pushed
else
pushed=$(date -u -d "$bumped - 10 minutes" +%Y-%m-%dT%H:%M:%SZ)
fi
note() {
local number=$1
local marker="<!-- droiddeck-rebuild-$now -->"
gh api "repos/$GITHUB_REPOSITORY/issues/$number/comments?per_page=100" --jq '.[].body' | grep -qF "$marker" && return 0
gh api -X POST "repos/$GITHUB_REPOSITORY/issues/$number/comments" -f body="$marker
Main is now at versionCode $now, so this PR's test build no longer installs over current DroidDeck, and its last build is too old for GitHub to re-run. Push a commit or merge main to get a new test build." >/dev/null
}
latest() {
gh api "repos/$GITHUB_REPOSITORY/actions/workflows/build.yml/runs?event=pull_request&head_sha=$1&per_page=20" \
--jq '[.workflow_runs[] | select(.head_sha == "'"$1"'")] | sort_by(.created_at) | last // empty | [.id, .status, (.run_started_at // .created_at), .created_at, .updated_at] | @tsv'
}
consider() {
local number=$1 head=$2 built=$3 id status started created updated
IFS=$'\t' read -r id status started created updated <<<"$4"
if [[ "$started" > "$bumped" ]]; then
echo "PR #$number: build $id started after the bump"
elif ! gh api "repos/$GITHUB_REPOSITORY/pulls/$number" |
jq -e --arg head "$head" '.state == "open" and .draft == false and .base.ref == "main" and .head.sha == $head' >/dev/null; then
echo "PR #$number: moved on since the scan, its own build covers it"
elif gh run rerun "$id" -R "$GITHUB_REPOSITORY"; then
echo "PR #$number: rebuilding ${head:0:7} on main (versionCode $built -> $now)"
else
echo "::warning::PR #$number: could not rerun build $id"
# GitHub only re-runs a workflow within 30 days of its first run.
if [[ "$created" < "$(date -u -d '-30 days' +%Y-%m-%dT%H:%M:%SZ)" ]]; then
note "$number" || echo "::warning::PR #$number: could not leave a note"
fi
fi
}
pending=()
declare -A seen=()
candidates() {
gh api --paginate "repos/Droid-Deck/DroidDeck-CI/releases?per_page=100" \
--jq '.[] | select(.tag_name | test("^pr-[0-9]+$")) | [(.tag_name | ltrimstr("pr-")), ((.body // "") | capture("(?m)^VersionCode: (?<v>[0-9]+)").v // "0")] | @tsv'
# The latest build of every open PR: one that started before the bump and was still running at it
# may have pinned the old main. This also covers a PR's first build and fork builds.
gh api --paginate -X GET "repos/$GITHUB_REPOSITORY/pulls" -f state=open -f base=main -f per_page=100 \
--jq '.[] | select(.draft | not) | [(.number | tostring), .head.sha] | @tsv' |
while IFS=$'\t' read -r number sha; do
run=$(latest "$sha")
[ -n "$run" ] || continue
IFS=$'\t' read -r _ status started _ updated <<<"$run"
if [[ "$started" < "$bumped" ]] && { [ "$status" != completed ] || [[ ! "$updated" < "$pushed" ]]; }; then
printf '%s\t?\n' "$number"
fi
done
}
found=$(mktemp)
candidates > "$found"
while IFS=$'\t' read -r number built; do
[ "$built" = "?" ] || [ "$built" -lt "$now" ] || continue
[ -z "${seen[$number]:-}" ] || continue
seen[$number]=1
pr=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$number") || continue
jq -e '.state == "open" and .draft == false and .base.ref == "main"' <<<"$pr" >/dev/null || continue
head=$(jq -r .head.sha <<<"$pr")
run=$(latest "$head")
if [ -z "$run" ]; then
echo "PR #$number: no build of ${head:0:7} to rerun"
elif [ "$(cut -f2 <<<"$run")" = completed ]; then
consider "$number" "$head" "$built" "$run"
else
pending+=("$number $head $built")
fi
done < "$found"
# Builds still running are polled together so one slow build cannot hold up the rest.
deadline=$((SECONDS + 150 * 60))
while [ ${#pending[@]} -gt 0 ] && [ "$SECONDS" -lt "$deadline" ]; do
sleep 60
left=()
for item in "${pending[@]}"; do
read -r number head built <<<"$item"
run=$(latest "$head")
if [ -n "$run" ] && [ "$(cut -f2 <<<"$run")" = completed ]; then
consider "$number" "$head" "$built" "$run"
else
left+=("$item")
fi
done
pending=(${left[@]+"${left[@]}"})
done
for item in ${pending[@]+"${pending[@]}"}; do
echo "::warning::PR #${item%% *}: its build did not finish in time"
done
+8 -25
View File
@@ -40,36 +40,19 @@ jobs:
private-key: ${{ secrets.DROIDDECK_CI_APP_KEY }}
owner: Droid-Deck
repositories: DroidDeck-CI
- name: Delete the test build
if: ${{ steps.state.outputs.closed == 'true' }}
env:
GH_TOKEN: ${{ steps.ci-token.outputs.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
retry() {
for attempt in 1 2 3 4; do
"$@" && return 0
[ "$attempt" = 4 ] || sleep $((attempt * 20))
done
return 1
}
existing=$(retry gh api --paginate "repos/Droid-Deck/DroidDeck-CI/releases?per_page=100" --jq '.[].tag_name')
found=0
for tag in "pr-$PR_NUMBER" "pr-$PR_NUMBER.0"; do
if grep -qxF "$tag" <<<"$existing"; then
retry gh release delete "$tag" -R Droid-Deck/DroidDeck-CI --yes --cleanup-tag
echo "Deleted $tag"
found=1
fi
done
[ "$found" = 1 ] || echo "No test build for PR #$PR_NUMBER"
- uses: actions/checkout@v4
if: ${{ steps.state.outputs.closed == 'true' }}
with:
ref: main
persist-credentials: false
- name: Delete the test build unless main still needs it
if: ${{ steps.state.outputs.closed == 'true' }}
env:
SOURCE_GITHUB_TOKEN: ${{ github.token }}
CI_GITHUB_TOKEN: ${{ steps.ci-token.outputs.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
# A merged PR's build stays until a Preview build carries the merge; build.yml and the sweep remove it then.
run: python3 tools/release/retire_test_builds.py --pr "$PR_NUMBER"
- name: Retire the Discord PR announcement
if: ${{ steps.state.outputs.closed == 'true' }}
env:
+42 -6
View File
@@ -226,6 +226,8 @@ jobs:
publish:
needs: [authorize, sign]
runs-on: ubuntu-24.04
outputs:
keep: ${{ steps.publish.outputs.keep }}
permissions:
actions: read
contents: read
@@ -322,12 +324,8 @@ jobs:
cp pr-packs/* signed/ 2>/dev/null || true
gh release upload "$tag" signed/* -R "$repo" --clobber
gh release edit "$tag" -R "$repo" --title "PR #$PR_NUMBER" --notes "$notes" --prerelease
keep=$(cd signed && ls | jq -R . | jq -sc .)
gh api "repos/$repo/releases/tags/$tag" |
jq -r --argjson keep "$keep" '.assets[] | select(.name as $n | $keep | index($n) | not) | .id' |
while IFS= read -r id; do
gh api --method DELETE "repos/$repo/releases/assets/$id" >/dev/null
done
# The previous push's files stay until the catalog names these (the prune job), so a download started from the old catalog still finds its APK.
echo "keep=$(cd signed && ls | jq -R . | jq -sc .)" >> "$GITHUB_OUTPUT"
published=$(gh release view "$tag" -R "$repo" --json tagName,assets)
jq -e --arg tag "$tag" '.tagName == $tag and (.assets | length) > 0' <<<"$published" >/dev/null
@@ -417,3 +415,41 @@ jobs:
if: ${{ always() && needs.publish.result != 'skipped' }}
uses: ./.github/workflows/update-catalog.yml
secrets: inherit
prune:
needs: [authorize, publish, catalog]
if: ${{ always() && needs.publish.result == 'success' && needs.catalog.result == 'success' }}
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/create-github-app-token@v2
id: ci-token
with:
app-id: ${{ vars.DROIDDECK_CI_APP_ID }}
private-key: ${{ secrets.DROIDDECK_CI_APP_KEY }}
owner: Droid-Deck
repositories: DroidDeck-CI
- name: Remove the previous push's files
env:
GH_TOKEN: ${{ steps.ci-token.outputs.token }}
PR_NUMBER: ${{ needs.authorize.outputs.pr_number }}
KEEP: ${{ needs.publish.outputs.keep }}
run: |
set -euo pipefail
repo=Droid-Deck/DroidDeck-CI
tag="pr-$PR_NUMBER"
# An app that read the catalog just before it changed may still be starting that download.
sleep 300
# Delete nothing the published catalog still names.
named=$(gh api -H "Accept: application/vnd.github.raw+json" "repos/$repo/contents/catalog.json?ref=main" |
jq -c --argjson pr "$PR_NUMBER" '[.tests[] | select(.pr == $pr) | .apks[].name]')
stale=$(jq -nr --argjson named "$named" --argjson keep "$KEEP" '$named - $keep | join(" ")')
if [ -n "$stale" ]; then
echo "::warning::The catalog still names $stale; keeping every file of $tag"
exit 0
fi
gh api "repos/$repo/releases/tags/$tag" |
jq -r --argjson keep "$KEEP" '.assets[] | select(.name as $n | $keep | index($n) | not) | .id' |
while IFS= read -r id; do
gh api --method DELETE "repos/$repo/releases/assets/$id" >/dev/null
done
+14 -28
View File
@@ -26,32 +26,18 @@ jobs:
private-key: ${{ secrets.DROIDDECK_CI_APP_KEY }}
owner: Droid-Deck
repositories: DroidDeck-CI
- name: Delete test builds whose PR is no longer open
- uses: actions/checkout@v4
with:
ref: main
persist-credentials: false
- name: Delete test builds of closed PRs, and of merged PRs a Preview build carries
env:
CI_TOKEN: ${{ steps.ci-token.outputs.token }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
retry() {
for attempt in 1 2 3 4; do
"$@" && return 0
[ "$attempt" = 4 ] || sleep $((attempt * 20))
done
return 1
}
tags=$(GH_TOKEN="$CI_TOKEN" retry gh api --paginate "repos/Droid-Deck/DroidDeck-CI/releases?per_page=100" --jq '.[].tag_name' |
grep -E '^pr-[0-9]+(\.0)?$' || true)
failed=0
for tag in $tags; do
number=${tag#pr-}
number=${number%.0}
state=$(retry gh api "repos/$GITHUB_REPOSITORY/pulls/$number" --jq .state) || { failed=1; continue; }
if [ "$state" != open ]; then
if GH_TOKEN="$CI_TOKEN" retry gh release delete "$tag" -R Droid-Deck/DroidDeck-CI --yes --cleanup-tag; then
echo "Deleted $tag (PR #$number is $state)"
else
failed=1
fi
fi
done
exit "$failed"
SOURCE_GITHUB_TOKEN: ${{ github.token }}
CI_GITHUB_TOKEN: ${{ steps.ci-token.outputs.token }}
run: python3 tools/release/retire_test_builds.py
catalog:
needs: sweep
if: ${{ always() }}
uses: ./.github/workflows/update-catalog.yml
secrets: inherit
+1 -1
View File
@@ -55,7 +55,7 @@ jobs:
jq -r --arg n "$2" '.assets // [] | .[] | select(.name == $n) | .digest // empty'
}
commit=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$BUILD_RUN" --jq .head_sha 2>/dev/null || echo "$GITHUB_SHA")
for name in proot directaudio tracking xbox comet butler powervr ubisoft; do
for name in proot directaudio tracking xbox comet butler powervr ubisoft rockstar dirt; do
file="packs/$name.tar.zst"
[ -f "$file" ] || { echo "::error::$name.tar.zst is missing from Build APK run $BUILD_RUN"; exit 1; }
sha=$(sha256sum "$file" | cut -d' ' -f1)