Skip to content

Conversation

Copy link

Copilot AI commented Feb 2, 2026

Refactor the libass build project to rely on mpvkit/BuildShared and reuse BuildShared GitHub Actions workflows via uses:.

  • Build scripts

    • Depend on BuildShared in Sources/BuildScripts/Package.swift.
    • Replace local build infrastructure with BuildShared imports and shared option/runner usage.
    • Add libass dependency flags in the BuildShared-based build class.
  • CI workflows

    • Switch build/check_version workflows to mpvkit/BuildShared/.github/workflows/*.
    • Add explicit permissions in wrapper workflows.

Example (build runner + shared options):

import BuildShared

let options = try ArgumentOptions.parse(CommandLine.arguments)
try BuildRunner.performCommand(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
    • Triggering command: /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
    • Triggering command: /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
    • Triggering command: /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.

Copilot AI changed the title [WIP] Refactor project to use BuildShared library and update GitHub Actions Refactor libass build to use BuildShared and shared workflows Feb 2, 2026
Copilot AI requested a review from cxfksword February 2, 2026 04:27
@cxfksword cxfksword marked this pull request as ready for review February 2, 2026 07:45
Copilot AI review requested due to automatic review settings February 2, 2026 07:45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接删除Base.swift

Copy link

Copilot AI left a 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
Copy link

Copilot AI Feb 2, 2026

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].

Suggested change
uses: mpvkit/BuildShared/.github/workflows/check_version.yml@main
uses: mpvkit/BuildShared/.github/workflows/check_version.yml@v1.0.0

Copilot uses AI. Check for mistakes.
uses: mpvkit/action/.github/workflows/build.yml@main
permissions:
contents: write
uses: mpvkit/BuildShared/.github/workflows/build.yml@main
Copy link

Copilot AI Feb 2, 2026

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].

Suggested change
uses: mpvkit/BuildShared/.github/workflows/build.yml@main
uses: mpvkit/BuildShared/.github/workflows/build.yml@v1.0.0

Copilot uses AI. Check for mistakes.
typealias PackageTarget = BuildShared.PackageTarget
typealias PlatformType = BuildShared.PlatformType
typealias ArchType = BuildShared.ArchType
typealias Utility = BuildShared.Utility
Copy link

Copilot AI Feb 2, 2026

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.

Suggested change
typealias Utility = BuildShared.Utility
typealias Utility = BuildShared.Utility
typealias BaseBuild = BuildShared.BaseBuild
typealias ArgumentOptions = BuildShared.ArgumentOptions
typealias BuildRunner = BuildShared.BuildRunner
typealias SharedBuildOptions = BuildShared.SharedBuildOptions

Copilot uses AI. Check for mistakes.
super.init(library: .libass)
}

override func flagsDependencelibrarys() -> [any BuildLibrary] {
Copy link

Copilot AI Feb 2, 2026

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.

Suggested change
override func flagsDependencelibrarys() -> [any BuildLibrary] {
override func flagsDependencyLibraries() -> [any BuildLibrary] {

Copilot uses AI. Check for mistakes.
products: [
],
dependencies: [
.package(url: "https://github.com/mpvkit/BuildShared.git", branch: "main"),
Copy link

Copilot AI Feb 2, 2026

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").

Suggested change
.package(url: "https://github.com/mpvkit/BuildShared.git", branch: "main"),
.package(url: "https://github.com/mpvkit/BuildShared.git", from: "1.0.0"),

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants