Add custom binary check-update support for artifacts

This commit is contained in:
crazywhalecc
2026-02-28 13:55:52 +08:00
parent ed5a516004
commit 40e36982d3
6 changed files with 111 additions and 2 deletions

View File

@@ -358,8 +358,13 @@ class ArtifactDownloader
/** @var CheckUpdateInterface $downloader */
$downloader = new $cls();
return $downloader->checkUpdate($artifact_name, $info['config'], $info['version'], $this);
}
throw new WrongUsageException("Artifact '{$artifact_name}' downloader does not support update checking, exit.");
} // custom binary: delegate to registered check-update callback
if (($callback = $artifact->getCustomBinaryCheckUpdateCallback()) !== null) {
return ApplicationContext::invoke($callback, [
ArtifactDownloader::class => $this,
'old_version' => $info['version'],
]);
} throw new WrongUsageException("Artifact '{$artifact_name}' downloader does not support update checking, exit.");
}
public function getRetry(): int