1- name : CI Test
1+ name : CI
22
33on :
44 push :
55 branches :
6- - ci
6+ - main
77 workflow_dispatch :
8- inputs :
9- version :
10- description : ' Release tag name (default mpv version)'
11- default : ' '
128
139jobs :
1410 build :
1511 permissions :
1612 contents : write
17- runs-on : macos-14
13+ runs-on : macos-latest
1814 steps :
1915 - uses : actions/checkout@v4
2016
21- - name : Check version to release
22- uses : jannekem/run-python-script-action@v1
23- with :
24- script : |
25- import re
17+ - name : Show Xcode version
18+ run : xcodebuild -version
2619
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}"
20+ - name : Show available SDKs
21+ run : xcodebuild -showsdks
3422
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
23+ - name : Build macOS
24+ id : build
6125 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
26+ xcodebuild -resolvePackageDependencies \
27+ -project Demo/Demo-macOS/Demo-macOS.xcodeproj \
28+ -scheme Demo-macOS
29+
30+ xcodebuild -project Demo/Demo-macOS/Demo-macOS.xcodeproj \
31+ -scheme Demo-macOS \
32+ -configuration Release \
33+ CODE_SIGN_IDENTITY="-" \
34+ CODE_SIGNING_REQUIRED=NO \
35+ CODE_SIGNING_ALLOWED=NO \
36+ build
37+
38+ - name : Build iOS
39+ id : build
7040 run : |
71- sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
72- xcodebuild -showsdks
41+ xcodebuild -resolvePackageDependencies \
42+ -project Demo/Demo-iOS/Demo-iOS.xcodeproj \
43+ -scheme Demo-iOS
7344
74- - name : Build GPL version
75- run : |
76- make build enable-gpl version=${{ env.RELEASE_VERSION }} platform=maccatalyst,xros,ios,macos
45+ xcodebuild -project Demo/Demo-iOS/Demo-iOS.xcodeproj \
46+ -scheme Demo-iOS \
47+ -configuration Release \
48+ CODE_SIGN_IDENTITY="-" \
49+ CODE_SIGNING_REQUIRED=NO \
50+ CODE_SIGNING_ALLOWED=NO \
51+ build
7752
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
53+
54+ - name : Build Succeeded
55+ run : |
56+ echo "Build completed successfully."
0 commit comments