-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor libass build to use BuildShared and shared workflows #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: cxfksword <[email protected]>
Co-authored-by: cxfksword <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接删除Base.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request refactors the libass build project to use the shared mpvkit/BuildShared library instead of maintaining local build infrastructure. The refactoring consolidates build logic, updates workflows to use shared GitHub Actions, and migrates to BuildShared's types and utilities.
Changes:
- Added BuildShared as a dependency and migrated to shared build infrastructure
- Replaced ~1300 lines of local build code with type aliases and imports from BuildShared
- Updated CI workflows to use shared reusable workflows from BuildShared repository
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/BuildScripts/Package.swift | Added BuildShared dependency and updated target configuration |
| Sources/BuildScripts/XCFrameworkBuild/base.swift | Replaced entire build infrastructure with type aliases to BuildShared components |
| Sources/BuildScripts/XCFrameworkBuild/main.swift | Updated to use BuildShared types (BuildRunner, SharedBuildOptions) and added BuildLibrary conformance |
| .github/workflows/build.yml | Switched to shared BuildShared workflow with explicit permissions |
| .github/workflows/check_version.yml | Switched to shared BuildShared workflow with explicit permissions |
| .gitignore | Added Package.resolved to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| uses: mpvkit/BuildShared/.github/workflows/check_version.yml@main |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using '@main' branch for the reusable workflow is not recommended for production as it can introduce breaking changes unexpectedly. Consider pinning to a specific version tag or commit SHA for stability and predictability. For example: uses: mpvkit/BuildShared/.github/workflows/[email protected].
| uses: mpvkit/BuildShared/.github/workflows/check_version.yml@main | |
| uses: mpvkit/BuildShared/.github/workflows/check_version.yml@v1.0.0 |
| uses: mpvkit/action/.github/workflows/build.yml@main | ||
| permissions: | ||
| contents: write | ||
| uses: mpvkit/BuildShared/.github/workflows/build.yml@main |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using '@main' branch for the reusable workflow is not recommended for production as it can introduce breaking changes unexpectedly. Consider pinning to a specific version tag or commit SHA for stability and predictability. For example: uses: mpvkit/BuildShared/.github/workflows/[email protected].
| uses: mpvkit/BuildShared/.github/workflows/build.yml@main | |
| uses: mpvkit/BuildShared/.github/workflows/build.yml@v1.0.0 |
| typealias PackageTarget = BuildShared.PackageTarget | ||
| typealias PlatformType = BuildShared.PlatformType | ||
| typealias ArchType = BuildShared.ArchType | ||
| typealias Utility = BuildShared.Utility |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing type aliases for BuildShared components that are used in main.swift. The following type aliases should be added:
typealias BaseBuild = BuildShared.BaseBuild(used in multiple classes in main.swift)typealias ArgumentOptions = BuildShared.ArgumentOptions(used on line 5 of main.swift)typealias BuildRunner = BuildShared.BuildRunner(used on line 6 of main.swift)typealias SharedBuildOptions = BuildShared.SharedBuildOptions(used throughout main.swift for releaseVersion)
Without these type aliases, the code in main.swift will not compile as it references these types without qualification.
| typealias Utility = BuildShared.Utility | |
| typealias Utility = BuildShared.Utility | |
| typealias BaseBuild = BuildShared.BaseBuild | |
| typealias ArgumentOptions = BuildShared.ArgumentOptions | |
| typealias BuildRunner = BuildShared.BuildRunner | |
| typealias SharedBuildOptions = BuildShared.SharedBuildOptions |
| super.init(library: .libass) | ||
| } | ||
|
|
||
| override func flagsDependencelibrarys() -> [any BuildLibrary] { |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method name 'flagsDependencelibrarys' appears to have a typo. It should likely be 'flagsDependenceLibraries' or 'flagsDependencyLibraries' for proper English spelling and Swift naming conventions. This should match the method name in the BuildShared.BaseBuild class. Please verify the correct spelling used in BuildShared and update accordingly.
| override func flagsDependencelibrarys() -> [any BuildLibrary] { | |
| override func flagsDependencyLibraries() -> [any BuildLibrary] { |
| products: [ | ||
| ], | ||
| dependencies: [ | ||
| .package(url: "https://github.com/mpvkit/BuildShared.git", branch: "main"), |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using 'branch: "main"' for the BuildShared dependency is not recommended for production code as it can lead to unpredictable builds when the main branch changes. Consider using a specific version tag or commit hash instead for reproducible builds. For example: .package(url: "https://github.com/mpvkit/BuildShared.git", from: "1.0.0") or .package(url: "https://github.com/mpvkit/BuildShared.git", exact: "1.0.0").
| .package(url: "https://github.com/mpvkit/BuildShared.git", branch: "main"), | |
| .package(url: "https://github.com/mpvkit/BuildShared.git", from: "1.0.0"), |
Refactor the libass build project to rely on
mpvkit/BuildSharedand reuse BuildShared GitHub Actions workflows viauses:.Build scripts
Sources/BuildScripts/Package.swift.CI workflows
mpvkit/BuildShared/.github/workflows/*.Example (build runner + shared options):
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/mpvkit/BuildShared/contents/Sources/BuildShared/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(http block)https://api.github.com/repos/mpvkit/BuildShared/tags/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(http block)r.jina.ai/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.