1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-12-03 13:47:47 +01:00
MadelineProto/tests/waitPackagist.php

25 lines
666 B
PHP
Raw Normal View History

2019-12-26 20:26:27 +01:00
#!/usr/bin/env php
<?php
2021-04-09 17:21:37 +02:00
$commit = \getenv('GITHUB_SHA');
2021-03-30 21:23:48 +02:00
$branch = \trim(\shell_exec("git rev-parse --abbrev-ref HEAD"));
$tag = \trim(\shell_exec("git tag --points-at HEAD"));
2021-03-30 21:18:38 +02:00
2021-03-30 21:20:36 +02:00
echo "Waiting for commit $commit on branch $branch (tag $tag)...".PHP_EOL;
2021-09-04 19:04:22 +02:00
if (\substr($tag, -5) === '.9999' || \substr($tag, -5) === '.9998') {
2021-09-04 17:37:48 +02:00
die;
}
2021-03-30 21:18:38 +02:00
$branch = $tag ? $tag : "dev-$branch";
2019-12-28 01:02:50 +01:00
2021-04-06 22:18:03 +02:00
$cur = 0;
2019-12-26 20:26:27 +01:00
while (true) {
2021-04-06 22:18:03 +02:00
$json = \json_decode(\file_get_contents("https://repo.packagist.org/p/danog/madelineproto.json?v=$cur"), true);
2021-03-30 21:18:38 +02:00
if ($json["packages"]["danog/madelineproto"][$branch]["source"]["reference"] === $commit) {
2019-12-26 20:26:27 +01:00
return;
}
2021-04-06 22:18:03 +02:00
\sleep(1);
$cur++;
2019-12-26 20:26:27 +01:00
}