mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-26 05:14:05 +00:00
Merge branch 'minor-next' into major-next
This commit is contained in:
commit
258038c9a9
22
.github/workflows/discord-release-embed.php
vendored
22
.github/workflows/discord-release-embed.php
vendored
@ -18,7 +18,12 @@ require dirname(__DIR__, 2) . '/vendor/autoload.php';
|
|||||||
/**
|
/**
|
||||||
* @phpstan-return array<string, mixed>
|
* @phpstan-return array<string, mixed>
|
||||||
*/
|
*/
|
||||||
function generateDiscordEmbed(string $version, string $channel, string $description, string $detailsUrl, string $sourceUrl, string $pharDownloadUrl, string $buildLogUrl, int $newsPingRoleId) : array{
|
function generateDiscordEmbed(string $version, string $channel, string $description, string $detailsUrl, string $sourceUrl, string $pharDownloadUrl, string $buildLogUrl, int $newsPingRoleId, ?string $phpDownloadUrl) : array{
|
||||||
|
if($phpDownloadUrl !== null){
|
||||||
|
$phpEmbedLink = " | [PHP Binaries]($phpDownloadUrl)";
|
||||||
|
}else{
|
||||||
|
$phpEmbedLink = "";
|
||||||
|
}
|
||||||
return [
|
return [
|
||||||
"content" => "<@&$newsPingRoleId> New PocketMine-MP release: $version ($channel)",
|
"content" => "<@&$newsPingRoleId> New PocketMine-MP release: $version ($channel)",
|
||||||
"embeds" => [
|
"embeds" => [
|
||||||
@ -27,7 +32,7 @@ function generateDiscordEmbed(string $version, string $channel, string $descript
|
|||||||
"description" => <<<DESCRIPTION
|
"description" => <<<DESCRIPTION
|
||||||
$description
|
$description
|
||||||
|
|
||||||
[Details]($detailsUrl) | [Source Code]($sourceUrl) | [Build Log]($buildLogUrl) | [Download]($pharDownloadUrl)
|
[Details]($detailsUrl) | [Source Code]($sourceUrl) | [Build Log]($buildLogUrl) | [Download]($pharDownloadUrl)$phpEmbedLink
|
||||||
DESCRIPTION,
|
DESCRIPTION,
|
||||||
"url" => $detailsUrl,
|
"url" => $detailsUrl,
|
||||||
"color" => $channel === "stable" ? 0x57ab5a : 0xc69026
|
"color" => $channel === "stable" ? 0x57ab5a : 0xc69026
|
||||||
@ -84,10 +89,21 @@ $detailsUrl = $buildInfoJson["details_url"];
|
|||||||
$sourceUrl = $buildInfoJson["source_url"];
|
$sourceUrl = $buildInfoJson["source_url"];
|
||||||
$pharDownloadUrl = $buildInfoJson["download_url"];
|
$pharDownloadUrl = $buildInfoJson["download_url"];
|
||||||
$buildLogUrl = $buildInfoJson["build_log_url"];
|
$buildLogUrl = $buildInfoJson["build_log_url"];
|
||||||
|
$phpBinaryUrl = $buildInfoJson["php_download_url"] ?? null;
|
||||||
|
|
||||||
$description = $releaseInfoJson["body"];
|
$description = $releaseInfoJson["body"];
|
||||||
|
|
||||||
$discordPayload = generateDiscordEmbed($buildInfoJson["base_version"], $buildInfoJson["channel"], $description, $detailsUrl, $sourceUrl, $pharDownloadUrl, $buildLogUrl, (int) $newsPingRoleId);
|
$discordPayload = generateDiscordEmbed(
|
||||||
|
$buildInfoJson["base_version"],
|
||||||
|
$buildInfoJson["channel"],
|
||||||
|
$description,
|
||||||
|
$detailsUrl,
|
||||||
|
$sourceUrl,
|
||||||
|
$pharDownloadUrl,
|
||||||
|
$buildLogUrl,
|
||||||
|
(int) $newsPingRoleId,
|
||||||
|
$phpBinaryUrl
|
||||||
|
);
|
||||||
|
|
||||||
$response = Internet::postURL(
|
$response = Internet::postURL(
|
||||||
$hookURL,
|
$hookURL,
|
||||||
|
21
.github/workflows/draft-release.yml
vendored
21
.github/workflows/draft-release.yml
vendored
@ -11,6 +11,8 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-version: [8.1]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -20,7 +22,7 @@ jobs:
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@2.25.5
|
uses: shivammathur/setup-php@2.25.5
|
||||||
with:
|
with:
|
||||||
php-version: 8.1
|
php-version: ${{ matrix.php-version }}
|
||||||
|
|
||||||
- name: Restore Composer package cache
|
- name: Restore Composer package cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -58,8 +60,21 @@ jobs:
|
|||||||
echo CHANGELOG_SUFFIX=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "" : "-" . \pocketmine\VersionInfo::BUILD_CHANNEL;') >> $GITHUB_OUTPUT
|
echo CHANGELOG_SUFFIX=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "" : "-" . \pocketmine\VersionInfo::BUILD_CHANNEL;') >> $GITHUB_OUTPUT
|
||||||
echo PRERELEASE=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "false" : "true";') >> $GITHUB_OUTPUT
|
echo PRERELEASE=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "false" : "true";') >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Generate PHP binary download URL
|
||||||
|
id: php-binary-url
|
||||||
|
run: |
|
||||||
|
echo PHP_BINARY_URL="${{ github.server_url }}/${{ github.repository_owner }}/PHP-Binaries/releases/tag/php-${{ matrix.php-version }}-latest" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Generate build info
|
- name: Generate build info
|
||||||
run: php build/generate-build-info-json.php ${{ github.sha }} ${{ steps.get-pm-version.outputs.PM_VERSION }} ${{ github.repository }} ${{ steps.build-number.outputs.BUILD_NUMBER }} ${{ github.run_id }} > build_info.json
|
run: |
|
||||||
|
php build/generate-build-info-json.php \
|
||||||
|
${{ github.sha }} \
|
||||||
|
${{ steps.get-pm-version.outputs.PM_VERSION }} \
|
||||||
|
${{ github.repository }} \
|
||||||
|
${{ steps.build-number.outputs.BUILD_NUMBER }} \
|
||||||
|
${{ github.run_id }} \
|
||||||
|
${{ steps.php-binary-url.outputs.PHP_BINARY_URL }} \
|
||||||
|
> build_info.json
|
||||||
|
|
||||||
- name: Upload release artifacts
|
- name: Upload release artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
@ -84,3 +99,5 @@ jobs:
|
|||||||
**For Minecraft: Bedrock Edition ${{ steps.get-pm-version.outputs.MCPE_VERSION }}**
|
**For Minecraft: Bedrock Edition ${{ steps.get-pm-version.outputs.MCPE_VERSION }}**
|
||||||
|
|
||||||
Please see the [changelogs](${{ github.server_url }}/${{ github.repository }}/blob/${{ steps.get-pm-version.outputs.PM_VERSION }}/changelogs/${{ steps.get-pm-version.outputs.PM_VERSION_SHORT }}${{ steps.get-pm-version.outputs.CHANGELOG_SUFFIX }}.md#${{ steps.get-pm-version.outputs.PM_VERSION_MD }}) for details.
|
Please see the [changelogs](${{ github.server_url }}/${{ github.repository }}/blob/${{ steps.get-pm-version.outputs.PM_VERSION }}/changelogs/${{ steps.get-pm-version.outputs.PM_VERSION_SHORT }}${{ steps.get-pm-version.outputs.CHANGELOG_SUFFIX }}.md#${{ steps.get-pm-version.outputs.PM_VERSION_MD }}) for details.
|
||||||
|
|
||||||
|
:information_source: Download the recommended PHP binary [here](${{ steps.php-binary-url.outputs.PHP_BINARY_URL }}).
|
||||||
|
@ -23,13 +23,13 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
if(count($argv) !== 6){
|
if(count($argv) !== 7){
|
||||||
fwrite(STDERR, "required args: <git hash> <tag name> <github repo (owner/name)> <build number> <github actions run ID>\n");
|
fwrite(STDERR, "required args: <git hash> <tag name> <github repo (owner/name)> <build number> <github actions run ID> <PHP binary download URL>\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
"php_version" => sprintf("%d.%d", PHP_MAJOR_VERSION, PHP_MINOR_VERSION),
|
"php_version" => sprintf("%d.%d", PHP_MAJOR_VERSION, PHP_MINOR_VERSION), //deprecated
|
||||||
"base_version" => \pocketmine\VersionInfo::BASE_VERSION,
|
"base_version" => \pocketmine\VersionInfo::BASE_VERSION,
|
||||||
"build" => (int) $argv[4],
|
"build" => (int) $argv[4],
|
||||||
"is_dev" => \pocketmine\VersionInfo::IS_DEVELOPMENT_BUILD,
|
"is_dev" => \pocketmine\VersionInfo::IS_DEVELOPMENT_BUILD,
|
||||||
@ -41,4 +41,5 @@ echo json_encode([
|
|||||||
"download_url" => "https://github.com/$argv[3]/releases/download/$argv[2]/PocketMine-MP.phar",
|
"download_url" => "https://github.com/$argv[3]/releases/download/$argv[2]/PocketMine-MP.phar",
|
||||||
"source_url" => "https://github.com/$argv[3]/tree/$argv[2]",
|
"source_url" => "https://github.com/$argv[3]/tree/$argv[2]",
|
||||||
"build_log_url" => "https://github.com/$argv[3]/actions/runs/$argv[5]",
|
"build_log_url" => "https://github.com/$argv[3]/actions/runs/$argv[5]",
|
||||||
|
"php_download_url" => $argv[6],
|
||||||
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR) . "\n";
|
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR) . "\n";
|
||||||
|
@ -44,7 +44,6 @@ parameters:
|
|||||||
stubFiles:
|
stubFiles:
|
||||||
- tests/phpstan/stubs/JsonMapper.stub
|
- tests/phpstan/stubs/JsonMapper.stub
|
||||||
- tests/phpstan/stubs/leveldb.stub
|
- tests/phpstan/stubs/leveldb.stub
|
||||||
- tests/phpstan/stubs/phpasn1.stub
|
|
||||||
- tests/phpstan/stubs/pmmpthread.stub
|
- tests/phpstan/stubs/pmmpthread.stub
|
||||||
reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings
|
reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings
|
||||||
staticReflectionClassNamePatterns:
|
staticReflectionClassNamePatterns:
|
||||||
|
@ -199,6 +199,7 @@ class CrashDump{
|
|||||||
if(($pos = strpos($error["message"], "\n")) !== false){
|
if(($pos = strpos($error["message"], "\n")) !== false){
|
||||||
$error["message"] = substr($error["message"], 0, $pos);
|
$error["message"] = substr($error["message"], 0, $pos);
|
||||||
}
|
}
|
||||||
|
$error["thread"] = "Main";
|
||||||
}
|
}
|
||||||
$error["message"] = mb_scrub($error["message"], 'UTF-8');
|
$error["message"] = mb_scrub($error["message"], 'UTF-8');
|
||||||
|
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* This file is part of the PHPASN1 library.
|
|
||||||
*
|
|
||||||
* Copyright © Friedrich Große <friedrich.grosse@gmail.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace FG\ASN1\Universal;
|
|
||||||
|
|
||||||
class Integer
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @param int|string $value
|
|
||||||
*/
|
|
||||||
public function __construct($value){}
|
|
||||||
|
|
||||||
/** @return int|string */
|
|
||||||
public function getContent(){}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user