diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3fb673a..1d42212 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -151,8 +151,8 @@ jobs: dependencies: - locked env: - DLOAD_PHAR: ".build/phar/DLOAD.phar" - DLOAD_PHAR_SIGNATURE: ".build/phar/DLOAD.phar.asc" + DLOAD_PHAR: ".build/phar/dload.phar" + DLOAD_PHAR_SIGNATURE: ".build/phar/dload.phar.asc" steps: - name: 📦 Check out the codebase uses: actions/checkout@v4.1.5 diff --git a/box.json.dist b/box.json.dist index 7e28511..05c31ce 100644 --- a/box.json.dist +++ b/box.json.dist @@ -11,6 +11,7 @@ "vendor" ], "files": [ + "resources/software.json", "resources/version.json", "bin/dload", "LICENSE.md", diff --git a/composer.lock b/composer.lock index 46998f4..1e7059a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dbf39497fd94af52687a2b0354f74e8c", + "content-hash": "df57e077a1a95a42cf8807266f002d67", "packages": [ { "name": "psr/container", @@ -398,16 +398,16 @@ }, { "name": "symfony/http-client", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "6e9db0025db565bcf8f1d46ed734b549e51e6045" + "reference": "b5e498f763e0bf5eed8dcd946e50a3b3f71d4ded" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/6e9db0025db565bcf8f1d46ed734b549e51e6045", - "reference": "6e9db0025db565bcf8f1d46ed734b549e51e6045", + "url": "https://api.github.com/repos/symfony/http-client/zipball/b5e498f763e0bf5eed8dcd946e50a3b3f71d4ded", + "reference": "b5e498f763e0bf5eed8dcd946e50a3b3f71d4ded", "shasum": "" }, "require": { @@ -471,7 +471,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.9" + "source": "https://github.com/symfony/http-client/tree/v6.4.10" }, "funding": [ { @@ -487,7 +487,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T07:59:05+00:00" + "time": "2024-07-15T09:26:24+00:00" }, { "name": "symfony/http-client-contracts", @@ -1218,30 +1218,38 @@ }, { "name": "composer/pcre", - "version": "3.1.4", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "04229f163664973f68f38f6f73d917799168ef24" + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", - "reference": "04229f163664973f68f38f6f73d917799168ef24", + "url": "https://api.github.com/repos/composer/pcre/zipball/ea4ab6f9580a4fd221e0418f2c357cdd39102a90", + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.8" + }, "require-dev": { - "phpstan/phpstan": "^1.3", + "phpstan/phpstan": "^1.11.8", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { "branch-alias": { "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "autoload": { @@ -1269,7 +1277,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.4" + "source": "https://github.com/composer/pcre/tree/3.2.0" }, "funding": [ { @@ -1285,7 +1293,7 @@ "type": "tidelift" } ], - "time": "2024-05-27T13:40:54+00:00" + "time": "2024-07-25T09:36:02+00:00" }, { "name": "composer/semver", @@ -1916,16 +1924,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.59.3", + "version": "v3.61.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" + "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/94a87189f55814e6cabca2d9a33b06de384a2ab8", + "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8", "shasum": "" }, "require": { @@ -2007,7 +2015,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.61.1" }, "funding": [ { @@ -2015,7 +2023,7 @@ "type": "github" } ], - "time": "2024-06-16T14:17:03+00:00" + "time": "2024-07-31T14:33:15+00:00" }, { "name": "jean85/pretty-package-versions", @@ -2505,21 +2513,21 @@ }, { "name": "pestphp/pest", - "version": "v2.34.9", + "version": "v2.35.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "ef120125e036bf84c9e46a9e62219702f5b92e16" + "reference": "d0ff2c8ec294b7aa7fcb0f3ddc4fdec864234646" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/ef120125e036bf84c9e46a9e62219702f5b92e16", - "reference": "ef120125e036bf84c9e46a9e62219702f5b92e16", + "url": "https://api.github.com/repos/pestphp/pest/zipball/d0ff2c8ec294b7aa7fcb0f3ddc4fdec864234646", + "reference": "d0ff2c8ec294b7aa7fcb0f3ddc4fdec864234646", "shasum": "" }, "require": { "brianium/paratest": "^7.3.1", - "nunomaduro/collision": "^7.10.0|^8.1.1", + "nunomaduro/collision": "^7.10.0|^8.3.0", "nunomaduro/termwind": "^1.15.1|^2.0.1", "pestphp/pest-plugin": "^2.1.1", "pestphp/pest-plugin-arch": "^2.7.0", @@ -2533,8 +2541,8 @@ }, "require-dev": { "pestphp/pest-dev-tools": "^2.16.0", - "pestphp/pest-plugin-type-coverage": "^2.8.4", - "symfony/process": "^6.4.0|^7.1.1" + "pestphp/pest-plugin-type-coverage": "^2.8.5", + "symfony/process": "^6.4.0|^7.1.3" }, "bin": [ "bin/pest" @@ -2597,7 +2605,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v2.34.9" + "source": "https://github.com/pestphp/pest/tree/v2.35.0" }, "funding": [ { @@ -2609,7 +2617,7 @@ "type": "github" } ], - "time": "2024-07-11T08:36:26+00:00" + "time": "2024-08-02T10:57:29+00:00" }, { "name": "pestphp/pest-plugin", @@ -3970,31 +3978,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -4038,7 +4046,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -4046,7 +4054,7 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", @@ -5112,16 +5120,16 @@ }, { "name": "symfony/console", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9" + "reference": "504974cbe43d05f83b201d6498c206f16fc0cdbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", + "url": "https://api.github.com/repos/symfony/console/zipball/504974cbe43d05f83b201d6498c206f16fc0cdbc", + "reference": "504974cbe43d05f83b201d6498c206f16fc0cdbc", "shasum": "" }, "require": { @@ -5186,7 +5194,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.9" + "source": "https://github.com/symfony/console/tree/v6.4.10" }, "funding": [ { @@ -5202,7 +5210,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:49:33+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/event-dispatcher", @@ -5428,16 +5436,16 @@ }, { "name": "symfony/finder", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c" + "reference": "af29198d87112bebdd397bd7735fbd115997824c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3ef977a43883215d560a2cecb82ec8e62131471c", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c", + "url": "https://api.github.com/repos/symfony/finder/zipball/af29198d87112bebdd397bd7735fbd115997824c", + "reference": "af29198d87112bebdd397bd7735fbd115997824c", "shasum": "" }, "require": { @@ -5472,7 +5480,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.4.8" + "source": "https://github.com/symfony/finder/tree/v6.4.10" }, "funding": [ { @@ -5488,7 +5496,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-24T07:06:38+00:00" }, { "name": "symfony/options-resolver", @@ -6156,16 +6164,16 @@ }, { "name": "symfony/string", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7" + "reference": "ccf9b30251719567bfd46494138327522b9a9446" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/76792dbd99690a5ebef8050d9206c60c59e681d7", - "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7", + "url": "https://api.github.com/repos/symfony/string/zipball/ccf9b30251719567bfd46494138327522b9a9446", + "reference": "ccf9b30251719567bfd46494138327522b9a9446", "shasum": "" }, "require": { @@ -6222,7 +6230,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.9" + "source": "https://github.com/symfony/string/tree/v6.4.10" }, "funding": [ { @@ -6238,20 +6246,20 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:25:38+00:00" + "time": "2024-07-22T10:21:14+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c31566e4ca944271cc8d8ac6887cbf31b8c6a172" + "reference": "a71cc3374f5fb9759da1961d28c452373b343dd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c31566e4ca944271cc8d8ac6887cbf31b8c6a172", - "reference": "c31566e4ca944271cc8d8ac6887cbf31b8c6a172", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/a71cc3374f5fb9759da1961d28c452373b343dd4", + "reference": "a71cc3374f5fb9759da1961d28c452373b343dd4", "shasum": "" }, "require": { @@ -6307,7 +6315,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.4.9" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.10" }, "funding": [ { @@ -6323,7 +6331,7 @@ "type": "tidelift" } ], - "time": "2024-06-27T13:23:14+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "ta-tikoma/phpunit-architecture-test", diff --git a/resources/software.json b/resources/software.json index 0c4db6d..ecfae8a 100644 --- a/resources/software.json +++ b/resources/software.json @@ -53,5 +53,57 @@ "pattern": "/^(dolt)(?:\\.exe)?$/" } ] + }, + { + "name": "ProtoC PHP gRPC Plugin", + "alias": "protoc-gen-php-grpc", + "description": "Protobuf PHP gRPC generator plugin", + "repositories": [ + { + "type": "github", + "uri": "roadrunner-server/roadrunner", + "asset-pattern": "/^protoc-gen-php-grpc-.*/" + } + ], + "files": [ + { + "pattern": "/^(protoc-gen-php-grpc)(?:\\.exe)?$/" + } + ] + }, + { + "name": "Protobuf compiler", + "alias": "protoc", + "homepage": "https://protobuf.dev/", + "repositories": [ + { + "type": "github", + "uri": "protocolbuffers/protobuf", + "asset-pattern": "/^protoc-.*/" + } + ], + "files": [ + { + "pattern": "/^(protoc)(?:\\.exe)?$/" + } + ] + }, + { + "name": "TigerBeetle ", + "alias": "tigerbeetle", + "description": "TigerBeetle is a financial transactions database designed for mission critical safety and performance to power the next 30 years of OLTP.", + "homepage": "https://tigerbeetle.com/", + "repositories": [ + { + "type": "github", + "uri": "tigerbeetle/tigerbeetle", + "asset-pattern": "/^tigerbeetle-.*/" + } + ], + "files": [ + { + "pattern": "/^(tigerbeetle)(?:\\.exe)?$/" + } + ] } ] diff --git a/src/Module/Common/Architecture.php b/src/Module/Common/Architecture.php index 54a0a5e..9fb0d6a 100644 --- a/src/Module/Common/Architecture.php +++ b/src/Module/Common/Architecture.php @@ -34,7 +34,7 @@ public static function fromGlobals(): self public static function tryFromString(string $arch): ?self { return match ($arch) { - 'AMD64', 'amd64', 'x86', 'x64', 'x86_64' => self::X86_64, + 'AMD64', 'amd64', 'x64', 'x86_64', 'win64' => self::X86_64, 'arm64', 'aarch64' => self::ARM_64, default => null, }; @@ -42,7 +42,7 @@ public static function tryFromString(string $arch): ?self public static function tryFromBuildName(string $name): ?self { - if (\preg_match('/(?:\b|_)(amd64|arm64|aarch64|x86_64|x64|x86)(?:\b|_)/i', $name, $matches) !== 1) { + if (\preg_match('/(?:\b|_)(amd64|arm64|aarch64|x86_64|x64|win64)(?:\b|_)/i', $name, $matches) !== 1) { return null; } diff --git a/src/Module/Common/OperatingSystem.php b/src/Module/Common/OperatingSystem.php index 6a2c2b4..c67c9d3 100644 --- a/src/Module/Common/OperatingSystem.php +++ b/src/Module/Common/OperatingSystem.php @@ -37,8 +37,8 @@ public static function fromGlobals(): self public static function tryFromString(string $name): ?self { return match (\strtolower($name)) { - 'windows' => self::Windows, - 'bSD' => self::BSD, + 'windows', 'win32', 'win64' => self::Windows, + 'bsd', 'freebsd' => self::BSD, 'darwin' => self::Darwin, 'linux' => \str_contains(\PHP_OS, 'alpine') ? self::Alpine @@ -49,10 +49,12 @@ public static function tryFromString(string $name): ?self public static function tryFromBuildName(string $name): ?self { - if (\preg_match('/(?:\b|_)(windows|linux|darwin|alpine|bsd|freebsd)(?:\b|_)/i', $name, $matches) !== 1) { - return null; - } - - return self::tryFromString(\strtolower($matches[1])); + return \preg_match( + '/(?:\b|_)(windows|linux|darwin|alpine|bsd|freebsd|win32|win64)(?:\b|_)/i', + $name, + $matches, + ) === 1 + ? self::tryFromString(\strtolower($matches[1])) + : null; } } diff --git a/src/Module/Repository/Internal/GitHub/GitHubRelease.php b/src/Module/Repository/Internal/GitHub/GitHubRelease.php index 833b5fa..a23539f 100644 --- a/src/Module/Repository/Internal/GitHub/GitHubRelease.php +++ b/src/Module/Repository/Internal/GitHub/GitHubRelease.php @@ -15,7 +15,8 @@ * @psalm-import-type GitHubAssetApiResponse from GitHubAsset * * @psalm-type GitHubReleaseApiResponse = array{ - * name: non-empty-string, + * name: string|null, + * tag-name: string|null, * assets: array * } * @@ -42,12 +43,12 @@ public function __construct( */ public static function fromApiResponse(GitHubRepository $repository, HttpClientInterface $client, array $data): self { - isset($data['name']) or throw new \InvalidArgumentException( - 'Passed array must contain "name" value of type string.', + isset($data['tag_name']) || isset($data['name']) or throw new \InvalidArgumentException( + 'Passed array must contain "tag_name" value of type string.', ); $name = self::getTagName($data); - $version = $data['tag_name'] ?? $data['name']; + $version = $data['tag_name'] ?? (string) $data['name']; $result = new self($client, $repository, $name, $version); $result->assets = AssetsCollection::from(static function () use ($client, $result, $data): \Generator { @@ -87,7 +88,7 @@ public function destroy(): void * * @note The return value is "pretty", but that does not mean that the tag physically exists. * - * @param array{tag_name: string, name: string} $data + * @param array{tag_name: string|null, name: string|null} $data * @return string */ private static function getTagName(array $data): string @@ -98,7 +99,7 @@ private static function getTagName(array $data): string return $parser->normalize($data['tag_name']); } catch (\Throwable $e) { try { - return $parser->normalize($data['name']); + return $parser->normalize((string) $data['name']); } catch (\Throwable $e) { return 'dev-' . $data['tag_name']; } diff --git a/tests/Unit/Module/Common/ArchitectureTest.php b/tests/Unit/Module/Common/ArchitectureTest.php index 4d93785..f79cf92 100644 --- a/tests/Unit/Module/Common/ArchitectureTest.php +++ b/tests/Unit/Module/Common/ArchitectureTest.php @@ -18,6 +18,7 @@ public static function provideBuildNames(): iterable yield ['temporal_cli_0.13.2_windows.amd644.tar.gz', null]; yield ['roadrunner-2024.1.5-windows.zip', null]; yield ['roadrunner-2024.1.5-linux-amd64.deb', Architecture::X86_64]; + yield ['protoc-27.3-win64.zip', Architecture::X86_64]; } #[DataProvider('provideBuildNames')] diff --git a/tests/Unit/Module/Common/OperatingSystemTest.php b/tests/Unit/Module/Common/OperatingSystemTest.php index df57379..0958ce2 100644 --- a/tests/Unit/Module/Common/OperatingSystemTest.php +++ b/tests/Unit/Module/Common/OperatingSystemTest.php @@ -17,6 +17,8 @@ public static function provideBuildNames(): iterable yield ['roadrunner-2024.1.5-linux-amd64.deb', OperatingSystem::Linux]; yield ['roadrunner-2024.1.5-linux-amd64.tar.gz', OperatingSystem::Linux]; yield ['roadrunner-2024.1.5-unknown-musl-amd64.tar.gz', null]; + yield ['protoc-27.3-win64.zip', OperatingSystem::Windows]; + yield ['protoc-27.3-win32.zip', OperatingSystem::Windows]; } #[DataProvider('provideBuildNames')]