Skip to content

Commit 6131b9d

Browse files
authored
Merge pull request #45 from mpvkit/ci
fix: support xcode 15
2 parents 50753f7 + e4eb249 commit 6131b9d

3 files changed

Lines changed: 97 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CI Test
2+
3+
on:
4+
push:
5+
branches:
6+
- ci
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Release tag name (default mpv version)'
11+
default: ''
12+
13+
jobs:
14+
build:
15+
permissions:
16+
contents: write
17+
runs-on: macos-14
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Check version to release
22+
uses: jannekem/run-python-script-action@v1
23+
with:
24+
script: |
25+
import re
26+
27+
def normalize_version(version_string):
28+
version_string = re.sub(r'[^.0-9]+|-.+', '', version_string)
29+
parts = re.split(r'\.', version_string)
30+
major = int(parts[0])
31+
minor = int(parts[1]) if len(parts) > 1 else 0
32+
patch = int(parts[2]) if len(parts) > 2 else 0
33+
return f"{major}.{minor}.{patch}"
34+
35+
file_path = './Sources/BuildScripts/XCFrameworkBuild/main.swift'
36+
with open(file_path, 'r', encoding='utf-8') as file:
37+
content = file.read()
38+
39+
mpvVersion = re.search(r'(case .libmpv[^"]+?)"(.+?)"', content).group(2)
40+
ffmpegVersion = re.search(r'(case .FFmpeg[^"]+?)"(.+?)"', content).group(2)
41+
libplaceboVersion = re.search(r'(case .libplacebo[^"]+?)"(.+?)"', content).group(2)
42+
vulkanVersion = re.search(r'(case .vulkan[^"]+?)"(.+?)"', content).group(2)
43+
44+
print(f'mpv version: {mpvVersion}')
45+
print(f'ffmpeg version: {ffmpegVersion}')
46+
releaseVersion = '${{ github.event.inputs.version }}' or normalize_version(mpvVersion)
47+
print(f'release version: {releaseVersion}')
48+
set_env('BUILD_VERSION', mpvVersion)
49+
set_env('RELEASE_VERSION', releaseVersion)
50+
51+
with open('/tmp/RELEASE_NOTE.txt', 'w', encoding='utf-8') as file:
52+
file.write(f'''
53+
* mpv version: {mpvVersion} ([changelog](https://github.com/mpv-player/mpv/releases/tag/{mpvVersion}))
54+
* ffmpeg version: {ffmpegVersion} ([changelog](https://github.com/FFmpeg/FFmpeg/blob/{ffmpegVersion}/Changelog))
55+
* placebo version: v{libplaceboVersion}
56+
* MoltenVK version: v{vulkanVersion}
57+
''')
58+
59+
60+
- name: Install dependencies
61+
run: |
62+
brew install autoconf
63+
brew install automake
64+
brew install libtool
65+
python -m pip install meson==1.4.2
66+
brew install ninja
67+
brew install rename
68+
69+
- name: Setup Xcode to support visionOS
70+
run: |
71+
sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
72+
xcodebuild -showsdks
73+
74+
- name: Build GPL version
75+
run: |
76+
make build enable-gpl version=${{ env.RELEASE_VERSION }} platform=maccatalyst,xros,ios,macos
77+
78+
cd ./dist/release
79+
rename 's/-all\.zip/-GPL-all\.zip/' *-all.zip
80+
rename 's/\.xcframework\.zip/-GPL\.xcframework\.zip/' *.xcframework.zip
81+
rename 's/\.xcframework\.checksum\.txt/-GPL\.xcframework\.checksum\.txt/' *.xcframework.checksum.txt

Sources/BuildScripts/XCFrameworkBuild/base.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,20 @@ enum Utility {
11851185
if let logURL = logURL {
11861186
// print log when run in GitHub Action
11871187
if ProcessInfo.processInfo.environment.keys.contains("GITHUB_ACTION") {
1188+
// if build FFmpeg failed, print the ffbuild/config.log content
1189+
if logURL.path.contains("FFmpeg") {
1190+
let ffbuildLogURL = logURL
1191+
.deletingPathExtension()
1192+
.appendingPathComponent("ffbuild/config.log")
1193+
if FileManager.default.fileExists(atPath: ffbuildLogURL.path) {
1194+
if let content = String(data: try Data(contentsOf: ffbuildLogURL), encoding: .utf8) {
1195+
print("############# \(ffbuildLogURL) CONTENT BEGIN #############")
1196+
print(content)
1197+
print("############# \(ffbuildLogURL) CONTENT END #############")
1198+
}
1199+
}
1200+
}
1201+
11881202
if let content = String(data: try Data(contentsOf: logURL), encoding: .utf8) {
11891203
print("############# \(logURL) CONTENT BEGIN #############")
11901204
print(content)

Sources/BuildScripts/XCFrameworkBuild/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ enum Library: String, CaseIterable {
7676
case .lcms2:
7777
return "7.349.0"
7878
case .libplacebo:
79-
return "7.351.0"
79+
return "7.351.0-fix"
8080
case .libdovi:
8181
return "3.3.0"
8282
case .vulkan:
83-
return "1.4.0"
83+
return "1.4.0-fix"
8484
case .libshaderc: // compiling GLSL (OpenGL Shading Language) shaders into SPIR-V (Standard Portable Intermediate Representation - Vulkan) code
8585
return "2025.4.0"
8686
case .libuchardet:

0 commit comments

Comments
 (0)