1111 build :
1212 permissions :
1313 contents : write
14- runs-on : macos-14
15- steps :
16- - uses : actions/checkout@v4
17-
18- - name : Install dependencies
19- run : |
20- brew install autoconf
21- brew install automake
22- brew install libtool
23- python -m pip install meson==1.4.2
24- brew install ninja
25- brew install nasm
26-
27- - name : Setup Xcode to support visionOS
28- run : |
29- sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
30- xcodebuild -showsdks
31-
32-
33- - name : Check version to release
34- uses : jannekem/run-python-script-action@v1
35- with :
36- script : |
37- import re
38-
39- def normalize_version(version_string):
40- version_string = re.sub(r'[^.0-9]+|-.+', '', version_string)
41- parts = re.split(r'\.', version_string)
42- major = int(parts[0])
43- minor = int(parts[1]) if len(parts) > 1 else 0
44- patch = int(parts[2]) if len(parts) > 2 else 0
45- return f"{major}.{minor}.{patch}"
46-
47- file_path = './Sources/BuildScripts/XCFrameworkBuild/main.swift'
48- with open(file_path, 'r', encoding='utf-8') as file:
49- content = file.read()
50- buildVersion = re.search(r'(case .libdav1d[^"]+?)"(.+?)"', content).group(2)
51- print(f'build version: {buildVersion}')
52- releaseVersion = '${{ github.event.inputs.version }}' or normalize_version(buildVersion)
53- print(f'release version: {releaseVersion}')
54- set_env('BUILD_VERSION', buildVersion)
55- set_env('RELEASE_VERSION', releaseVersion)
56-
57- - name : Build
58- run : |
59- make build version=${{ env.RELEASE_VERSION }}
60-
61- - name : Update Package.swift
62- run : |
63- rm -rf ./Package.swift
64- cp -f ./dist/release/Package.swift ./Package.swift
65-
66- - name : Push Package.swift
67- uses : EndBug/add-and-commit@v9
68- with :
69- default_author : github_actions
70- add : |
71- - Package.swift
72- message : " chore: bump version to ${{ env.BUILD_VERSION }}"
73- push : " origin HEAD:${{ github.ref_name }}"
74-
75- - name : Upload binary to GitHub Release
76- uses : softprops/action-gh-release@v2
77- with :
78- name : ${{ contains(env.RELEASE_VERSION, '-') && env.RELEASE_VERSION || env.BUILD_VERSION }}
79- tag_name : ${{ env.RELEASE_VERSION }}
80- files : |
81- ./dist/release/*.txt
82- ./dist/release/*.zip
83- prerelease : ${{ contains(env.RELEASE_VERSION, '-') }}
84- generate_release_notes : true
85- fail_on_unmatched_files : true
86- body : |
87- https://github.com/videolan/dav1d/releases/tag/${{ env.BUILD_VERSION }}
88-
89- 
14+ uses : mpvkit/BuildShared/.github/workflows/build.yml@main
15+ secrets : inherit
16+ with :
17+ version : ' ${{ github.event.inputs.version }}'
18+ library : ' libdav1d'
0 commit comments