From 180991f7d87e2a4fab35ec1e70a6eafc79c529cc Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Wed, 18 Oct 2023 10:55:57 +0800 Subject: [PATCH 1/2] add detection for ghrel prerelease --- src/SPC/store/Downloader.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/SPC/store/Downloader.php b/src/SPC/store/Downloader.php index c8bdf1799..b421acfbd 100644 --- a/src/SPC/store/Downloader.php +++ b/src/SPC/store/Downloader.php @@ -99,12 +99,18 @@ public static function getLatestGithubRelease(string $name, array $source): arra hooks: [[CurlHook::class, 'setupGithubToken']], ), true); $url = null; - foreach ($data[0]['assets'] as $asset) { - if (preg_match('|' . $source['match'] . '|', $asset['name'])) { - $url = $asset['browser_download_url']; - break; + foreach ($data as $release) { + if ($release['prerelease'] === true) { + continue; + } + foreach ($release['assets'] as $asset) { + if (preg_match('|' . $source['match'] . '|', $asset['name'])) { + $url = $asset['browser_download_url']; + break 2; + } } } + if (!$url) { throw new DownloaderException("failed to find {$name} source"); } From a2da863cb27877cb3ea9d21d5deb9383729a5751 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Wed, 18 Oct 2023 10:56:14 +0800 Subject: [PATCH 2/2] change icu to ghrel --- config/source.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/source.json b/config/source.json index a7af224fc..072988816 100644 --- a/config/source.json +++ b/config/source.json @@ -128,8 +128,9 @@ } }, "icu": { - "type": "url", - "url": "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz", + "type": "ghrel", + "repo": "unicode-org/icu", + "match": "icu4c.+-src\\.tgz", "license": { "type": "file", "path": "LICENSE"