From 6971bdf7ec8fa074aaec1d0359e8869254578659 Mon Sep 17 00:00:00 2001 From: cxfksword <718792+cxfksword@users.noreply.github.com> Date: Tue, 11 Nov 2025 10:32:44 +0800 Subject: [PATCH 1/3] ci: fix build error --- .github/workflows/ci.yml | 78 +++++++++++++++++++ .../BuildScripts/XCFrameworkBuild/base.swift | 16 ++++ 2 files changed, 94 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8a1a2b0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,78 @@ +name: CI Test + +on: + workflow_dispatch: + inputs: + version: + description: 'Release tag name (default mpv version)' + default: '' + +jobs: + build: + permissions: + contents: write + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + + - name: Check version to release + uses: jannekem/run-python-script-action@v1 + with: + script: | + import re + + def normalize_version(version_string): + version_string = re.sub(r'[^.0-9]+|-.+', '', version_string) + parts = re.split(r'\.', version_string) + major = int(parts[0]) + minor = int(parts[1]) if len(parts) > 1 else 0 + patch = int(parts[2]) if len(parts) > 2 else 0 + return f"{major}.{minor}.{patch}" + + file_path = './Sources/BuildScripts/XCFrameworkBuild/main.swift' + with open(file_path, 'r', encoding='utf-8') as file: + content = file.read() + + mpvVersion = re.search(r'(case .libmpv[^"]+?)"(.+?)"', content).group(2) + ffmpegVersion = re.search(r'(case .FFmpeg[^"]+?)"(.+?)"', content).group(2) + libplaceboVersion = re.search(r'(case .libplacebo[^"]+?)"(.+?)"', content).group(2) + vulkanVersion = re.search(r'(case .vulkan[^"]+?)"(.+?)"', content).group(2) + + print(f'mpv version: {mpvVersion}') + print(f'ffmpeg version: {ffmpegVersion}') + releaseVersion = '${{ github.event.inputs.version }}' or normalize_version(mpvVersion) + print(f'release version: {releaseVersion}') + set_env('BUILD_VERSION', mpvVersion) + set_env('RELEASE_VERSION', releaseVersion) + + with open('/tmp/RELEASE_NOTE.txt', 'w', encoding='utf-8') as file: + file.write(f''' + * mpv version: {mpvVersion} ([changelog](https://github.com/mpv-player/mpv/releases/tag/{mpvVersion})) + * ffmpeg version: {ffmpegVersion} ([changelog](https://github.com/FFmpeg/FFmpeg/blob/{ffmpegVersion}/Changelog)) + * placebo version: v{libplaceboVersion} + * MoltenVK version: v{vulkanVersion} + ''') + + + - name: Install dependencies + run: | + brew install autoconf + brew install automake + brew install libtool + python -m pip install meson==1.4.2 + brew install ninja + brew install rename + + - name: Setup Xcode to support visionOS + run: | + sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer + xcodebuild -showsdks + + - name: Build GPL version + run: | + make build enable-gpl version=${{ env.RELEASE_VERSION }} platform=maccatalyst,xros,ios,macos + + cd ./dist/release + rename 's/-all\.zip/-GPL-all\.zip/' *-all.zip + rename 's/\.xcframework\.zip/-GPL\.xcframework\.zip/' *.xcframework.zip + rename 's/\.xcframework\.checksum\.txt/-GPL\.xcframework\.checksum\.txt/' *.xcframework.checksum.txt diff --git a/Sources/BuildScripts/XCFrameworkBuild/base.swift b/Sources/BuildScripts/XCFrameworkBuild/base.swift index d8dbaa1..1bd57d9 100644 --- a/Sources/BuildScripts/XCFrameworkBuild/base.swift +++ b/Sources/BuildScripts/XCFrameworkBuild/base.swift @@ -1185,6 +1185,22 @@ enum Utility { if let logURL = logURL { // print log when run in GitHub Action if ProcessInfo.processInfo.environment.keys.contains("GITHUB_ACTION") { + // if build FFmpeg failed, print the ffbuild/config.log content + if logURL.path.contains("FFmpeg") { + var ffbuildLogURL = logURL + ffbuildLogURL.deletePathExtension() + print(ffbuildLogURL.path) + ffbuildLogURL = ffbuildLogURL.appendingPathComponent("ffbuild/config.log") + print(ffbuildLogURL.path) + if FileManager.default.fileExists(atPath: ffbuildLogURL.path) { + if let content = String(data: try Data(contentsOf: ffbuildLogURL), encoding: .utf8) { + print("############# \(ffbuildLogURL) CONTENT BEGIN #############") + print(content) + print("############# \(ffbuildLogURL) CONTENT END #############") + } + } + } + if let content = String(data: try Data(contentsOf: logURL), encoding: .utf8) { print("############# \(logURL) CONTENT BEGIN #############") print(content) From 5f795bd204a2a4fadf16f6e9ec139cd74cd84022 Mon Sep 17 00:00:00 2001 From: cxfksword <718792+cxfksword@users.noreply.github.com> Date: Tue, 11 Nov 2025 10:34:36 +0800 Subject: [PATCH 2/3] ci: fix build error --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a1a2b0..cd694b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: CI Test on: + push: + branches: + - ci workflow_dispatch: inputs: version: From e4eb249a180a06e56674e41ba046a25c7782abb9 Mon Sep 17 00:00:00 2001 From: cxfksword <718792+cxfksword@users.noreply.github.com> Date: Tue, 11 Nov 2025 14:22:24 +0800 Subject: [PATCH 3/3] fix: support xcode 15 --- Sources/BuildScripts/XCFrameworkBuild/base.swift | 8 +++----- Sources/BuildScripts/XCFrameworkBuild/main.swift | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Sources/BuildScripts/XCFrameworkBuild/base.swift b/Sources/BuildScripts/XCFrameworkBuild/base.swift index 1bd57d9..e71da48 100644 --- a/Sources/BuildScripts/XCFrameworkBuild/base.swift +++ b/Sources/BuildScripts/XCFrameworkBuild/base.swift @@ -1187,11 +1187,9 @@ enum Utility { if ProcessInfo.processInfo.environment.keys.contains("GITHUB_ACTION") { // if build FFmpeg failed, print the ffbuild/config.log content if logURL.path.contains("FFmpeg") { - var ffbuildLogURL = logURL - ffbuildLogURL.deletePathExtension() - print(ffbuildLogURL.path) - ffbuildLogURL = ffbuildLogURL.appendingPathComponent("ffbuild/config.log") - print(ffbuildLogURL.path) + let ffbuildLogURL = logURL + .deletingPathExtension() + .appendingPathComponent("ffbuild/config.log") if FileManager.default.fileExists(atPath: ffbuildLogURL.path) { if let content = String(data: try Data(contentsOf: ffbuildLogURL), encoding: .utf8) { print("############# \(ffbuildLogURL) CONTENT BEGIN #############") diff --git a/Sources/BuildScripts/XCFrameworkBuild/main.swift b/Sources/BuildScripts/XCFrameworkBuild/main.swift index 42a83fa..c34efc3 100644 --- a/Sources/BuildScripts/XCFrameworkBuild/main.swift +++ b/Sources/BuildScripts/XCFrameworkBuild/main.swift @@ -76,11 +76,11 @@ enum Library: String, CaseIterable { case .lcms2: return "7.349.0" case .libplacebo: - return "7.351.0" + return "7.351.0-fix" case .libdovi: return "3.3.0" case .vulkan: - return "1.4.0" + return "1.4.0-fix" case .libshaderc: // compiling GLSL (OpenGL Shading Language) shaders into SPIR-V (Standard Portable Intermediate Representation - Vulkan) code return "2025.4.0" case .libuchardet: