|
| 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 |
0 commit comments