Skip to content

Commit

Permalink
[Build] Release v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dries-c committed May 22, 2024
1 parent 6685a31 commit ac00c9d
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 35 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,23 @@ jobs:
steps:
- name: Startup
uses: actions/checkout@v3
- name: Checkout PharBuilder
uses: actions/checkout@v3
with:
repository: NetherGamesMC/PharBuilder
token: ${{ secrets.ng_token }}
path: PharBuilder
ref: pm5
- name: Install FFI
run: sudo apt install -y libffi7
- name: Download PHP Release
uses: dsaltares/fetch-gh-release-asset@1.1.0
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
file: Linux.zip
file: PHP-Linux-x86_64-PM5.tar.gz
repo: NetherGamesMC/php-build-scripts
version: "tags/8.2-pm5"
version: "tags/php-8.3-ffi-latest"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unpack PHP Release
run: unzip Linux.zip && tar -xzvf PHP_Linux-x86_64.tar.gz
run: tar -xzvf PHP-Linux-x86_64-PM5.tar.gz
- name: Download Composer
run: curl -o ./bin/composer.phar "https://getcomposer.org/composer-stable.phar"
- name: Install Composer dependencies
run: |
./bin/php7/bin/php ./bin/composer.phar install --prefer-dist --no-interaction --no-dev
run: ./bin/php7/bin/php ./bin/composer.phar install --prefer-dist --no-interaction --no-dev
- name: Download pharbuilder-rs
uses: dsaltares/fetch-gh-release-asset@1.1.0
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
file: pharbuilder
repo: NetherGamesMC/pharbuilder-rs
Expand All @@ -42,10 +36,10 @@ jobs:
run: |
echo Building...
chmod +x pharbuilder
./pharbuilder -i . -o PharBuilder/ProxyTransport.phar
./pharbuilder -i . -o ./ProxyTransport.phar
echo Build completed!
- name: Upload
uses: actions/upload-artifact@v3
with:
name: ProxyTransport
path: PharBuilder/ProxyTransport.phar
path: ProxyTransport.phar
14 changes: 8 additions & 6 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ jobs:
steps:
- name: Startup
uses: actions/checkout@v3
- name: Install FFI
run: sudo apt install -y libffi7
- name: Download PHP Release
uses: dsaltares/fetch-gh-release-asset@1.1.0
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
file: Linux.zip
file: PHP-Linux-x86_64-PM5.tar.gz
repo: NetherGamesMC/php-build-scripts
version: "tags/8.2-pm5"
version: "tags/php-8.3-ffi-latest"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unpack PHP Release
run: unzip Linux.zip && tar -xzvf PHP_Linux-x86_64.tar.gz
run: tar -xzvf PHP-Linux-x86_64-PM5.tar.gz
- name: Download Composer
run: curl -o composer.phar "https://getcomposer.org/composer-stable.phar"
run: curl -o ./bin/composer.phar "https://getcomposer.org/composer-stable.phar"
- name: Install Composer dependencies
run: ./bin/php7/bin/php composer.phar install --prefer-dist --no-interaction
run: ./bin/php7/bin/php ./bin/composer.phar install --prefer-dist --no-interaction
- name: Run PHPStan
run: ./bin/php7/bin/php vendor/bin/phpstan.phar analyze --no-progress
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"php": "^8.1",
"ext-pmmpthread": "^6.0.1",
"ext-sockets": "*",
"nethergamesmc/libproxy": "dev-tcp"
"nethergamesmc/libproxy": "dev-pm5"
},
"require-dev": {
"phpstan/phpstan": "1.10.8",
"nethergamesmc/pocketmine-mp": "dev-stable"
},
"repositories": [
{ "type": "vcs", "url": "git@github.com:NetherGamesMC/libproxy.git" },
{ "type": "vcs", "url": "git@github.com:NetherGamesMC/PocketMine-MP.git" }
{ "type": "vcs", "url": "git@github.com:NetherGamesMC/PocketMine-MP.git" },
{ "type": "vcs", "url": "git@github.com:NetherGamesMC/libproxy.git" }
],
"autoload": {
"psr-4": {
Expand Down
210 changes: 202 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: ProxyTransport
version: 1.0
version: 1.1.0
main: NetherGames\ProxyTransport\ProxyTransport
api: [4.18.0]
api: [5.0.0]
author: NetherGamesMC
11 changes: 11 additions & 0 deletions src/NetherGames/ProxyTransport/ProxyTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

use libproxy\ProxyNetworkInterface;
use NetherGames\ProxyTransport\tasks\ComposerRegisterAsyncTask;
use pocketmine\event\EventPriority;
use pocketmine\event\server\NetworkInterfaceRegisterEvent;
use pocketmine\network\mcpe\raklib\RakLibInterface;
use pocketmine\network\query\DedicatedQueryNetworkInterface;
use pocketmine\plugin\PluginBase;
use function date_default_timezone_set;
use function is_file;
Expand Down Expand Up @@ -38,6 +42,13 @@ public function onLoad(): void
public function onEnable(): void
{
$server = $this->getServer();
$server->getPluginManager()->registerEvent(NetworkInterfaceRegisterEvent::class, function(NetworkInterfaceRegisterEvent $event): void{
$interface = $event->getInterface();
if($interface instanceof RakLibInterface || $interface instanceof DedicatedQueryNetworkInterface){
$event->cancel();
}
}, EventPriority::MONITOR, $this);

$server->getNetwork()->registerInterface(
new ProxyNetworkInterface($this, $server->getPort(), COMPOSER_AUTOLOADER_PATH)
);
Expand Down

0 comments on commit ac00c9d

Please sign in to comment.