Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/// A protocol for downloading binary dependencies from git repositories.
protocol BinaryDependenciesDownloader {
/// Downloads the source code as a zip archive from the specified repo and release tag.
///
/// - Parameters:
/// - repo: Git repository, e.g. "owner/repo".
/// - tag: The release tag to download.
/// - outputFilePath: The output file path for the downloaded archive.
/// - Throws: If the download fails.
func downloadSourceCode(
repo: String,
tag: String,
outputFilePath: String
) throws

/// Downloads a specific release asset from git repo matching the provided pattern.
///
/// - Parameters:
/// - repo: Git repository, e.g. "owner/repo".
/// - tag: The release tag to download.
/// - pattern: Optional asset name pattern to select the correct file.
/// - outputFilePath: Where to save the downloaded asset.
/// - Throws: If the download fails.
func downloadReleaseAsset(
repo: String,
tag: String,
pattern: String?,
outputFilePath: String
) throws
}

extension CLI.GitHub: BinaryDependenciesDownloader {}