Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
be20cf6
Desktop: build a working Windows MSI and add a Windows CI job
harsh-pockt Oct 1, 2026
7058a6b
Merge pull request #1 from harsh-pockt/desktop-windows
harsh-pockt Oct 1, 2026
3fe7bd6
Desktop: save settings, log to a file and remember the window
harsh-pockt Oct 1, 2026
a1cb010
Merge pull request #2 from harsh-pockt/desktop-platform
harsh-pockt Oct 1, 2026
ebcb4a7
Desktop: navigation rail and settings screens
harsh-pockt Oct 1, 2026
27a6d57
Merge pull request #3 from harsh-pockt/desktop-shell
harsh-pockt Oct 1, 2026
ed95a16
Desktop: install and load extensions from repositories
harsh-pockt Oct 1, 2026
4165c03
Desktop: explain when a repository has no desktop extensions
harsh-pockt Oct 1, 2026
0cd9f86
Merge pull request #4 from harsh-pockt/desktop-plugins
harsh-pockt Oct 2, 2026
1d760a4
Desktop: Search and Home screens
harsh-pockt Oct 2, 2026
37ec617
Merge pull request #5 from harsh-pockt/desktop-home-search
harsh-pockt Oct 2, 2026
fa60433
Desktop: detail page and video playback with mpv
harsh-pockt Oct 2, 2026
296fe1a
Merge pull request #6 from harsh-pockt/desktop-player
harsh-pockt Oct 2, 2026
4b43625
Desktop: repository short codes and MegaRepo
harsh-pockt Oct 2, 2026
53c5683
Merge pull request #7 from harsh-pockt/desktop-android-extensions
harsh-pockt Oct 2, 2026
938355f
Implement Android extension conversion and stubbing support
harsh-pockt Oct 2, 2026
ab19b9c
Desktop: extension pages, updates and fresh start
harsh-pockt Oct 2, 2026
fac91b0
Merge pull request #8 from harsh-pockt/desktop-extensions-polish
harsh-pockt Oct 2, 2026
e299b23
Desktop: library and resume watching
harsh-pockt Oct 2, 2026
e1eeb39
Merge pull request #9 from harsh-pockt/desktop-library-resume
harsh-pockt Oct 2, 2026
4a0aa22
Desktop: search history and extension toasts
harsh-pockt Oct 2, 2026
ae0e846
Merge pull request #10 from harsh-pockt/desktop-search-history
harsh-pockt Oct 2, 2026
22ccb03
Desktop: easier player controls, panels and subtitles
harsh-pockt Oct 2, 2026
ba5c15e
Merge pull request #11 from harsh-pockt/desktop-player-fixes
harsh-pockt Oct 2, 2026
22b2565
Desktop: player redesign, buffering spinner and audio picker
harsh-pockt Oct 2, 2026
0ff6d0a
Merge pull request #12 from harsh-pockt/desktop-player-polish
harsh-pockt Oct 2, 2026
94bb90b
Desktop: predictable player keys, full screen and back
harsh-pockt Oct 2, 2026
1472b48
Desktop: M hides the app and pauses the video
harsh-pockt Oct 2, 2026
8d84785
Merge pull request #13 from harsh-pockt/desktop-player-navigation
harsh-pockt Oct 3, 2026
2ab7700
Merge pull request #14 from harsh-pockt/desktop-boss-key
harsh-pockt Oct 3, 2026
2dd14b4
Desktop: subtitle settings and auto-select language
harsh-pockt Oct 3, 2026
e28b270
Merge pull request #15 from harsh-pockt/desktop-subtitle-settings
harsh-pockt Oct 3, 2026
3aa189f
Desktop: lower memory use and one shared HTTP client
harsh-pockt Oct 3, 2026
e4906be
Merge pull request #16 from harsh-pockt/desktop-performance
harsh-pockt Oct 3, 2026
b0281a0
Fix Episode.addDate reading dates with no offset as UTC
harsh-pockt Oct 3, 2026
bfa3821
Desktop: download movies and episodes to play offline
harsh-pockt Oct 3, 2026
2496992
Desktop: solve Cloudflare checks and WebView lookups with Edge
harsh-pockt Oct 3, 2026
8a75135
Desktop: stream torrents and magnet links through TorrServer
harsh-pockt Oct 3, 2026
99d87ce
Merge pull request #17 from harsh-pockt/desktop-episode-date
harsh-pockt Oct 3, 2026
1f350cc
Merge pull request #18 from harsh-pockt/desktop-downloads
harsh-pockt Oct 3, 2026
1637519
Merge pull request #20 from harsh-pockt/desktop-torrents
harsh-pockt Oct 3, 2026
e1f10ed
Merge remote-tracking branch 'fork/master' into desktop-cloudflare
harsh-pockt Oct 3, 2026
8884ae6
Merge pull request #19 from harsh-pockt/desktop-cloudflare
harsh-pockt Oct 3, 2026
2435c7c
Desktop: safer plugin installs, from the review of 938355fa
harsh-pockt Oct 3, 2026
e17f53d
Desktop: hard limits for the extension run, and an AppCompatActivity
harsh-pockt Oct 3, 2026
b1500bb
Merge pull request #22 from harsh-pockt/desktop-plugin-safety
harsh-pockt Oct 3, 2026
4103ef3
Merge pull request #23 from harsh-pockt/desktop-extension-run
harsh-pockt Oct 3, 2026
a3c05c9
Desktop: fetch libmpv and 7zr from the fork's mirror release
harsh-pockt Oct 3, 2026
e85452e
Merge pull request #24 from harsh-pockt/desktop-libmpv-mirror
harsh-pockt Oct 3, 2026
7f424f6
Desktop: convert memory-hungry extensions within the app's 1 GB, and …
harsh-pockt Oct 3, 2026
d54ec10
Merge pull request #25 from harsh-pockt/desktop-large-extensions
harsh-pockt Oct 3, 2026
d395ac7
Desktop: run Edge headless, so playing a video never opens a browser …
harsh-pockt Oct 3, 2026
e228387
Desktop: sites that want a human check come last, and a browser windo…
harsh-pockt Oct 3, 2026
aea708f
Desktop: a Skip button while links load, to play the best found so far
harsh-pockt Oct 3, 2026
9ec53d0
Desktop: pick the source to download from, as on Android
harsh-pockt Oct 3, 2026
7f2dc85
Merge pull request #26 from harsh-pockt/desktop-headless-browser
harsh-pockt Oct 3, 2026
f2c1aac
Merge pull request #27 from harsh-pockt/desktop-skip-links
harsh-pockt Oct 3, 2026
6971fea
Desktop: wait for the subtitle as well when a test deletes a download
harsh-pockt Oct 3, 2026
939bce1
Merge pull request #28 from harsh-pockt/desktop-download-picker
harsh-pockt Oct 3, 2026
d632375
Desktop: the Installed page says when part of an extension could not …
harsh-pockt Oct 3, 2026
52e94bd
Merge pull request #29 from harsh-pockt/desktop-disabled-methods
harsh-pockt Oct 3, 2026
8bdb485
Desktop: leave NiceHttp's cancelled-request traces out of the console…
harsh-pockt Oct 3, 2026
0503aa9
Merge pull request #30 from harsh-pockt/desktop-quiet-cancels
harsh-pockt Oct 3, 2026
ef8a546
Build libmpv on the fork and keep the complete source it was built from
harsh-pockt Oct 3, 2026
b8431a2
Release workflow for the Windows app, and an updater that sees pre-re…
harsh-pockt Oct 3, 2026
6415633
libmpv workflow: set a git committer for the patches, and list the co…
harsh-pockt Oct 3, 2026
1e215c2
libmpv workflow: build with Clang, as shinchiro's published builds are
harsh-pockt Oct 3, 2026
e1d8416
libmpv workflow: hold curl back before it needed a newer OpenSSL
harsh-pockt Oct 3, 2026
aa48503
libmpv workflow: pack every library's source, and keep the compiler c…
harsh-pockt Oct 3, 2026
26e8fb5
libmpv workflow: leave out links that point into the deleted build tree
harsh-pockt Oct 3, 2026
19b55d2
Merge pull request #31 from harsh-pockt/desktop-libmpv-build
harsh-pockt Oct 4, 2026
a65444e
Merge pull request #32 from harsh-pockt/desktop-release-workflow
harsh-pockt Oct 4, 2026
3c23f29
Desktop: play video with the libmpv we built, whose source we publish
harsh-pockt Oct 4, 2026
0e66678
Merge pull request #33 from harsh-pockt/desktop-libmpv-own-build
harsh-pockt Oct 4, 2026
79058bc
Desktop: stop offering the installed beta as an update, and let betas…
harsh-pockt Oct 4, 2026
93db1ed
Merge pull request #34 from harsh-pockt/desktop-version-loop
harsh-pockt Oct 4, 2026
a3e0cc6
Release a beta of the Windows app on every merge into master
harsh-pockt Oct 4, 2026
b8d36f4
Merge pull request #35 from harsh-pockt/desktop-release-on-merge
harsh-pockt Oct 4, 2026
6e4a4dc
Desktop: look like the Android app, with its buttons, chips, dialogs …
harsh-pockt Oct 4, 2026
b79ca99
Merge pull request #36 from harsh-pockt/desktop-android-theme
harsh-pockt Oct 4, 2026
a55bd9e
Desktop player: the picture keeps its size when the bars or a panel c…
harsh-pockt Oct 4, 2026
ed453ef
Desktop player: the wheel sets volume on the right and brightness on …
harsh-pockt Oct 4, 2026
39f7daa
Merge pull request #37 from harsh-pockt/desktop-player-video-size
harsh-pockt Oct 4, 2026
0d7da16
Merge pull request #39 from harsh-pockt/desktop-player-wheel
harsh-pockt Oct 4, 2026
63b8e39
Desktop update: ask for administrator permission before quitting, so …
harsh-pockt Oct 4, 2026
8d2d7cf
Merge pull request #40 from harsh-pockt/desktop-update-elevate
harsh-pockt Oct 4, 2026
a434ec1
Desktop browser: no hidden Edge tabs in Alt+Tab
harsh-pockt Oct 16, 2026
f5b5982
Desktop player: no flicker and no white line in full screen
harsh-pockt Oct 16, 2026
f7e4872
Desktop player: aspect ratio, volume up to 130 %, hidden cursor, bigg…
harsh-pockt Oct 16, 2026
7f60f81
Merge pull request #41 from harsh-pockt/desktop-browser-popups
harsh-pockt Oct 16, 2026
b071b4c
Merge pull request #42 from harsh-pockt/desktop-player-fullscreen
harsh-pockt Oct 16, 2026
52b0e56
Merge pull request #43 from harsh-pockt/desktop-player-features
harsh-pockt Oct 16, 2026
6a3e017
Desktop player: aspect menu zooms, and closes once a choice is made
harsh-pockt Oct 16, 2026
8a95a53
Merge pull request #44 from harsh-pockt/desktop-player-aspect
harsh-pockt Oct 16, 2026
46d0dfe
Desktop player: a new source carries on where the last one was, also …
harsh-pockt Oct 16, 2026
02e1d76
Merge pull request #45 from harsh-pockt/desktop-player-resume
harsh-pockt Oct 16, 2026
be7ec2b
Desktop: a Search button on title pages, and a smaller Continue watch…
harsh-pockt Oct 16, 2026
42d4dad
Desktop UI: cards grow under the mouse, rows have arrows, darker them…
harsh-pockt Oct 16, 2026
95c2cc4
Desktop UI: a featured banner on Home, and a slim side bar
harsh-pockt Oct 16, 2026
463327c
Desktop UI: the dark theme in Prime Video colours, blue-black with a …
harsh-pockt Oct 16, 2026
bad541c
Merge pull request #46 from harsh-pockt/desktop-ui-search-continue
harsh-pockt Oct 16, 2026
c73fc1d
Merge pull request #47 from harsh-pockt/desktop-ui-quick-wins
harsh-pockt Oct 16, 2026
d9f2619
Merge pull request #48 from harsh-pockt/desktop-ui-banner-nav
harsh-pockt Oct 16, 2026
9322b76
Merge pull request #49 from harsh-pockt/desktop-ui-prime-theme
harsh-pockt Oct 16, 2026
c9e7f1f
Desktop UI: a floating glass dock at the bottom, and Continue watchin…
harsh-pockt Oct 16, 2026
80a0fc8
Desktop UI: the Home banner shows the extension's title logo, score a…
harsh-pockt Oct 16, 2026
5e6fad3
Merge pull request #50 from harsh-pockt/desktop-ui-dock-continue
harsh-pockt Oct 16, 2026
b68905e
Merge pull request #51 from harsh-pockt/desktop-ui-banner-extension-data
harsh-pockt Oct 16, 2026
b3a8058
Desktop UI: the theme on the window frame, the player and the setting…
harsh-pockt Oct 16, 2026
64529d2
Merge pull request #52 from harsh-pockt/desktop-ui-theme-everywhere
harsh-pockt Oct 16, 2026
30e394e
Desktop UI: a Prime-style light theme, settings cards, a glass Home b…
harsh-pockt Oct 16, 2026
1b3e0e9
Merge pull request #53 from harsh-pockt/desktop-ui-theme-polish
harsh-pockt Oct 16, 2026
2aeaeec
Desktop UI: a fuller title page, pill buttons in the theme's accent, …
harsh-pockt Oct 16, 2026
b716f53
Merge pull request #54 from harsh-pockt/desktop-ui-title-page
harsh-pockt Oct 16, 2026
074ba3a
Downloads: deleting a download cleans up safely, even a file held open
harsh-pockt Oct 16, 2026
202d244
Merge pull request #55 from harsh-pockt/desktop-download-delete-cleanup
harsh-pockt Oct 16, 2026
d9b3601
CI: spend far fewer Actions minutes
harsh-pockt Oct 16, 2026
2165502
Merge pull request #56 from weaponlions/ci-save-actions-minutes
weaponlions Oct 16, 2026
15edd18
Desktop player: a far seek that the server never answers opens the fi…
harsh-pockt Oct 17, 2026
4fda5ec
Merge pull request #57 from weaponlions/desktop-player-seek-stall
weaponlions Oct 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Desktop Build

# Checks a pull request: the tests, and that the desktop app compiles. Nothing runs on the merge
# itself, the pull request was checked already. The installer is only built when the workflow is
# run by hand ("Run workflow" in the Actions tab), to try a build before releasing it.

on:
pull_request:
paths-ignore:
- '**.md'
- '.github/workflows/libmpv.yml'
- '.github/workflows/release.yml'
workflow_dispatch:

permissions:
contents: read

# A new push to a pull request stops the check of the commit before it
concurrency:
group: desktop-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
windows:
runs-on: windows-latest
timeout-minutes: 40
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6

- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
cache-read-only: ${{ github.event_name == 'pull_request' }}

- name: Run tests
run: ./gradlew :library:jvmTest :shared:jvmTest :desktopApp:jvmTest

- name: Build MSI
if: github.event_name == 'workflow_dispatch'
run: ./gradlew :desktopApp:packageMsi

- name: Upload MSI
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v7
with:
name: desktop-windows-msi
path: desktopApp/build/compose/binaries/main/msi/*.msi
if-no-files-found: error

- name: Upload test reports
if: failure()
uses: actions/upload-artifact@v7
with:
name: desktop-test-reports
path: |
library/build/reports/tests/jvmTest/
shared/build/reports/tests/jvmTest/
desktopApp/build/reports/tests/jvmTest/
317 changes: 317 additions & 0 deletions .github/workflows/libmpv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
name: libmpv

# Builds libmpv-2.dll for the Windows app with shinchiro's mpv-winbuild-cmake, and keeps the complete
# source it was built from. libmpv includes GPL parts (FFmpeg, x264 and others), so every app release
# must come with that source. The build scripts follow each library's main branch and record nothing,
# so the commits are written down here, after the build, from the source folders themselves.
#
# It builds with Clang, as shinchiro's published builds are: their GCC build has not passed since
# April 2026. The LLVM toolchain takes hours, so it is built in a job of its own and kept in the
# cache; it is rebuilt only when the build scripts change or the cache has expired.
#
# Run it by hand with "publish" to make a release holding the build, its source and the list of
# versions; desktopApp/build.gradle.kts then points at that release. A pull request that changes this
# file runs it without publishing, to check it still builds.

on:
workflow_dispatch:
inputs:
winbuild_ref:
description: shinchiro/mpv-winbuild-cmake commit with the build scripts
default: 05a60b3cfd04e3e3b89918f4a27f3dde2935dff2
publish:
description: Publish the build and its source as a release of this repository
type: boolean
default: false

permissions:
contents: read

env:
WINBUILD_REF: ${{ inputs.winbuild_ref || '05a60b3cfd04e3e3b89918f4a27f3dde2935dff2' }}
TOOLCHAIN_CACHE: clang-toolchain-v1-${{ inputs.winbuild_ref || '05a60b3cfd04e3e3b89918f4a27f3dde2935dff2' }}

jobs:
toolchain:
runs-on: ubuntu-latest
timeout-minutes: 355
# shinchiro's build image, with the tools the scripts expect
container:
image: ghcr.io/shinchiro/archlinux:latest
defaults:
run:
shell: bash
steps:
- name: Look for a toolchain built earlier
id: cache
uses: actions/cache/restore@v6
with:
path: |
winbuild/clang_root
winbuild/build
key: ${{ env.TOOLCHAIN_CACHE }}-${{ github.run_id }}
restore-keys: ${{ env.TOOLCHAIN_CACHE }}-
lookup-only: true

- name: Check out the build scripts
if: steps.cache.outputs.cache-matched-key == ''
run: |
git config --global --add safe.directory '*'
# The scripts apply their patches with git am, which needs a committer
git config --global user.name "github-actions"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git clone https://github.com/shinchiro/mpv-winbuild-cmake.git winbuild
git -C winbuild checkout --quiet "$WINBUILD_REF"

# As shinchiro's llvm_clang.yml, without the profile-guided second pass: that makes the
# compiler faster, it does not change what the compiler builds
- name: Build LLVM, Clang and the MinGW runtime
if: steps.cache.outputs.cache-matched-key == ''
working-directory: winbuild
run: |
cmake -DTARGET_ARCH=x86_64-w64-mingw32 -DCOMPILER_TOOLCHAIN=clang -DCMAKE_INSTALL_PREFIX=$PWD/clang_root \
-DMINGW_INSTALL_PREFIX=$PWD/build/x86_64-w64-mingw32 -DSINGLE_SOURCE_LOCATION=$PWD/src_packages \
-DRUSTUP_LOCATION=$PWD/clang_root/install_rustup -G Ninja -B build -S .
ninja -C build llvm
ninja -C build rustup
ninja -C build cargo-clean
ninja -C build llvm-clang
rm -rf build/toolchain build/packages

# The runtime libraries built here (libc++, compiler-rt, the MinGW CRT, winpthreads) end up in
# libmpv-2.dll, so their source is kept with the toolchain, with the commits it was built from
- name: Keep the toolchain's source
if: steps.cache.outputs.cache-matched-key == ''
working-directory: winbuild
run: |
for dir in src_packages/*/; do
lib=$(basename "$dir")
# Configuring makes an empty folder for every library, built here or not
[[ -z "$(ls -A "$dir")" ]] && continue
if git -C "$dir" rev-parse --git-dir > /dev/null 2>&1 && [[ "$(git -C "$dir" rev-parse --show-toplevel)" == "$(cd "$dir" && pwd)" ]]; then
base=$(git -C "$dir" merge-base HEAD '@{u}' 2> /dev/null || git -C "$dir" rev-parse HEAD)
printf '%-24s %s %s\n' "$lib" "$(git -C "$dir" remote get-url origin)" "$base"
else
printf '%-24s from an archive, in the source as it was unpacked\n' "$lib"
fi
done > clang_root/toolchain-sources.txt
cat clang_root/toolchain-sources.txt
7z a -t7z -mx=7 -mmt=on -xr'!.git' clang_root/toolchain-source.7z src_packages
ls -la clang_root/toolchain-source.7z

- name: Collect the logs
if: failure()
run: find winbuild/build -type f -name '*-*.log' -print0 | tar -czf toolchain-logs.tar.gz --null -T - || true

- name: Keep the logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: toolchain-logs
path: toolchain-logs.tar.gz
retention-days: 3

- name: Save the toolchain for later runs
if: steps.cache.outputs.cache-matched-key == ''
uses: actions/cache/save@v6
with:
path: |
winbuild/clang_root
winbuild/build
key: ${{ env.TOOLCHAIN_CACHE }}-${{ github.run_id }}

build:
needs: toolchain
runs-on: ubuntu-latest
timeout-minutes: 355
container:
image: ghcr.io/shinchiro/archlinux:latest
defaults:
run:
shell: bash
outputs:
name: ${{ steps.package.outputs.name }}
steps:
- name: Check out the build scripts
run: |
git config --global --add safe.directory '*'
git config --global user.name "github-actions"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git clone https://github.com/shinchiro/mpv-winbuild-cmake.git winbuild
git -C winbuild checkout --quiet "$WINBUILD_REF"
git -C winbuild log -1 --format='%H %cI %s'

# A library that follows its main branch can move past what the others it is built with
# support. Each is held back here at a commit, as the scripts already do for OpenSSL:
# - curl 978cce12 (2 October 2026) needs ASN1_STRING_get_length, which the OpenSSL commit the
# scripts pin does not have yet. Held at its parent
- name: Hold back libraries that no longer build
working-directory: winbuild
run: |
for pin in curl=318bd978ea2d36ace36b42da2174b79c3abd89a3; do
lib=${pin%%=*} commit=${pin#*=}
grep -q GIT_RESET packages/$lib.cmake && { echo "packages/$lib.cmake already holds a commit"; exit 1; }
sed -i "0,/GIT_REPOSITORY .*/s//&\n GIT_REMOTE_NAME origin\n GIT_RESET $commit/" packages/$lib.cmake
grep -nE 'GIT_(REPOSITORY|REMOTE_NAME|RESET)' packages/$lib.cmake
done

- name: Restore the toolchain
uses: actions/cache/restore@v6
with:
path: |
winbuild/clang_root
winbuild/build
key: ${{ env.TOOLCHAIN_CACHE }}-${{ github.run_id }}
restore-keys: ${{ env.TOOLCHAIN_CACHE }}-
fail-on-cache-miss: true

# The compiler's cache from the last run: a library that has not changed since is not compiled
# again. Most help when a run is repeated after a failure
- name: Restore the compiler cache
uses: actions/cache/restore@v6
with:
path: winbuild/build/x86_64-w64-mingw32/ccache
key: libmpv-ccache-${{ github.run_id }}
restore-keys: libmpv-ccache-

# As shinchiro's mpv_clang.yml, with room in the compiler cache for every library
- name: Configure and download the sources
working-directory: winbuild
run: |
cmake -DTARGET_ARCH=x86_64-w64-mingw32 -DCOMPILER_TOOLCHAIN=clang -DCMAKE_INSTALL_PREFIX=$PWD/clang_root \
-DMINGW_INSTALL_PREFIX=$PWD/build/x86_64-w64-mingw32 -DSINGLE_SOURCE_LOCATION=$PWD/src_packages \
-DRUSTUP_LOCATION=$PWD/clang_root/install_rustup -DENABLE_CCACHE=ON -DCCACHE_MAXSIZE=2G -DCLANG_PACKAGES_LTO=ON \
-G Ninja --fresh -B build -S .
ninja -C build download || true

- name: Build mpv
working-directory: winbuild
run: ninja -C build mpv

- name: Save the compiler cache
if: ${{ !cancelled() }}
uses: actions/cache/save@v6
with:
path: winbuild/build/x86_64-w64-mingw32/ccache
key: libmpv-ccache-${{ github.run_id }}

- name: Package libmpv
id: package
working-directory: winbuild
run: |
ninja -C build mpv-packaging
mkdir -p ../out
mv build/mpv-dev-x86_64-*.7z ../out/
name=$(basename ../out/mpv-dev-x86_64-*.7z .7z)
echo "name=$name" >> "$GITHUB_OUTPUT"
(cd ../out && sha256sum "$name.7z" > "$name.7z.sha256")

# After the build, each source folder holds the commit it was built from: the scripts update a
# library just before building it, and once built, reset it to that commit without their
# patches, which are in packages/. Configuring makes an empty folder for every library, which
# is skipped. The toolchain may come from an earlier run, so its commits are those that run
# wrote down; the libraries it built are those with a commit there
- name: Write down every version
working-directory: winbuild
run: |
name=${{ steps.package.outputs.name }}
awk '$2 ~ /^https?:/' clang_root/toolchain-sources.txt > ../toolchain-sources.txt
toolchain=" $(cut -d' ' -f1 ../toolchain-sources.txt | tr '\n' ' ') "
{
echo "# Sources of $name.7z"
echo "# Built $(date -u +%Y-%m-%dT%H:%MZ) by $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
echo "# Build scripts: https://github.com/shinchiro/mpv-winbuild-cmake $(git rev-parse HEAD)"
echo "# Container: $(grep ^PRETTY_NAME /etc/os-release | cut -d= -f2) (ghcr.io/shinchiro/archlinux)"
echo
echo "# Toolchain, its source is in clang_root/toolchain-source.7z"
cat ../toolchain-sources.txt
echo
echo "# Libraries"
for dir in src_packages/*/; do
lib=$(basename "$dir")
[[ "$toolchain" == *" $lib "* || -z "$(ls -A "$dir")" ]] && continue
if git -C "$dir" rev-parse --git-dir > /dev/null 2>&1 && [[ "$(git -C "$dir" rev-parse --show-toplevel)" == "$(cd "$dir" && pwd)" ]]; then
base=$(git -C "$dir" merge-base HEAD '@{u}' 2> /dev/null || git -C "$dir" rev-parse HEAD)
printf '%-24s %s %s\n' "$lib" "$(git -C "$dir" remote get-url origin)" "$base"
else
printf '%-24s from an archive, in the source as it was unpacked\n' "$lib"
fi
done
} > ../out/$name-sources.txt
cat ../out/$name-sources.txt

# Every library's source, the toolchain's source, the build scripts with their patches, and the
# Rust crates the Rust libraries were built with. Git history is left out, the commits are in the
# list above. The toolchain folders downloaded in this run are left out too: the toolchain was
# built from those in toolchain-source.7z. Split into parts below GitHub's 2 GB limit per file
- name: Pack the complete source
working-directory: winbuild
run: |
name=${{ steps.package.outputs.name }}
# The build tree is done with, and the runner's disk is small
rm -rf build/packages
# Links into the build tree, such as compile_commands.json, now point at nothing
find src_packages -xtype l -print -delete
df -h .
exclude=()
for lib in $(cut -d' ' -f1 ../toolchain-sources.txt); do exclude+=("-x!src_packages/$lib"); done
# The Rust crates are in the registry, and in git checkouts only when one comes from git
paths=()
for path in clang_root/install_rustup/.cargo/registry/src clang_root/install_rustup/.cargo/git/checkouts; do
[[ -d $path ]] && paths+=("$path")
done
7z a -t7z -mx=7 -mmt=on -v1900m -xr'!.git' "${exclude[@]}" ../out/$name-source.7z \
src_packages CMakeLists.txt README.md cargo_config.in ccache_conf.in exec.in meson_cross.txt.in toolchain.cmake.in \
cmake packages scripts toolchain clang_root/toolchain-source.7z "${paths[@]}" \
../out/$name-sources.txt
ls -la ../out
(cd ../out && sha256sum $name-source.7z.* > $name-source.7z.sha256)

- name: Collect the logs
if: failure()
run: find winbuild/build -type f \( -name '*-*.log' -o -path '*/ffbuild/config.log' \) -print0 | tar -czf build-logs.tar.gz --null -T - || true

- name: Keep the logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: build-logs
path: build-logs.tar.gz
retention-days: 3

- name: Keep the build
uses: actions/upload-artifact@v7
with:
name: libmpv
path: out/
retention-days: 7
compression-level: 0

publish:
needs: build
if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v8
with:
name: libmpv
path: out

- name: Publish
env:
GH_TOKEN: ${{ github.token }}
NAME: ${{ needs.build.outputs.name }}
run: |
tag="libmpv-${NAME#mpv-dev-x86_64-}"
{
echo "libmpv for the Windows app, built with Clang from shinchiro/mpv-winbuild-cmake by $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID."
echo
echo "- \`$NAME.7z\`: libmpv-2.dll and its headers, which the app's build downloads"
echo "- \`$NAME-source.7z.*\`: the complete source it was built from (a multi-part 7z, open the .001 part)"
echo "- \`$NAME-sources.txt\`: every library with the commit it was built from"
echo
echo "libmpv-2.dll includes GPL parts, so it is distributed under the GNU GPL version 2 or later."
} > notes.md
gh release create "$tag" out/* --repo "$GITHUB_REPOSITORY" --title "libmpv ${NAME#mpv-dev-x86_64-}" --notes-file notes.md --prerelease
Loading
Loading