Skip to content

Commit 470c718

Browse files
committed
setup
0 parents  commit 470c718

File tree

7 files changed

+3358
-0
lines changed

7 files changed

+3358
-0
lines changed

.github/workflows/build.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
phpstan:
10+
name: PHPStan Analysis
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Startup
15+
uses: actions/checkout@v3
16+
17+
- name: Download PHP Release
18+
uses: dsaltares/[email protected]
19+
with:
20+
file: PHP-8.3-Linux-x86_64-PM5.tar.gz
21+
repo: pmmp/PHP-Binaries
22+
version: "tags/pm5-php-8.3-latest"
23+
24+
- name: Unpack PHP Release
25+
run: tar -xzvf PHP-8.3-Linux-x86_64-PM5.tar.gz
26+
27+
- name: Download Composer
28+
run: curl -o composer.phar "https://getcomposer.org/composer-stable.phar"
29+
30+
- name: Config Composer
31+
run: ./bin/php7/bin/php composer.phar config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Install Composer dependencies
34+
run: ./bin/php7/bin/php composer.phar install --prefer-dist --no-interaction --ignore-platform-req=ext-iconv
35+
36+
- name: Run PHPStan
37+
run: ./bin/php7/bin/php vendor/bin/phpstan.phar analyze --no-progress
38+
39+
build:
40+
name: Build
41+
runs-on: ubuntu-latest
42+
needs: phpstan
43+
44+
steps:
45+
- name: Startup
46+
uses: actions/checkout@v3
47+
48+
- name: Download PHP Release
49+
uses: dsaltares/[email protected]
50+
with:
51+
file: PHP-8.3-Linux-x86_64-PM5.tar.gz
52+
repo: pmmp/PHP-Binaries
53+
version: "tags/pm5-php-8.3-latest"
54+
55+
- name: Unpack PHP Release
56+
run: tar -xzvf PHP-8.3-Linux-x86_64-PM5.tar.gz
57+
58+
- name: Download Composer
59+
run: curl -o composer.phar "https://getcomposer.org/composer-stable.phar"
60+
61+
- name: Config Composer
62+
run: ./bin/php7/bin/php composer.phar config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
63+
64+
- name: Install Composer dependencies
65+
run: ./bin/php7/bin/php composer.phar install --prefer-dist --no-interaction --ignore-platform-req=ext-iconv
66+
67+
- name: Run Build
68+
run: ./bin/php7/bin/php -dphar.readonly=0 vendor/bin/pharynx -i . -c -p=DisableLocateBar.phar
69+
70+
- name: Get plugin.yml information
71+
run: |
72+
name=$(grep -oP '(?<=name: ).*' plugin.yml || echo "unknown")
73+
version=$(grep -oP '(?<=version: ).*' plugin.yml || echo "unknown")
74+
75+
echo "Name of plugin: $name"
76+
echo "Version of plugin: $version"
77+
78+
echo "PLUGIN_NAME=$name" >> $GITHUB_ENV
79+
echo "PLUGIN_VERSION=$version" >> $GITHUB_ENV
80+
81+
- name: Create Release
82+
uses: ncipollo/[email protected]
83+
with:
84+
artifacts: ${{ github.workspace }}/DisableLocateBar.phar
85+
draft: false
86+
name: ${{ env.PLUGIN_NAME }} v${{ env.PLUGIN_VERSION }} Release
87+
tag: v${{ env.PLUGIN_VERSION }}
88+
token: ${{ secrets.GITHUB_TOKEN }}
89+
body: "The artifacts are kept up to date with the master branch"
90+
commit: ${{ github.sha }}
91+
allowUpdates: true
92+
removeArtifacts: true
93+
replacesArtifacts: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.idea
2+
/vendor
3+
*.phar

composer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "josscoder/disable-locate-bar",
3+
"type": "pocketmine-plugin",
4+
"autoload": {
5+
"psr-4": {
6+
"Josscoder\\DisableLocateBar\\": "/src/Josscoder/DisableLocateBar"
7+
}
8+
},
9+
"authors": [
10+
{
11+
"name": "Josscoder",
12+
"email": "[email protected]"
13+
}
14+
],
15+
"minimum-stability": "dev",
16+
"repositories": [
17+
{
18+
"type": "vcs",
19+
"url": "[email protected]:Josscoder/UltraCitizens.git"
20+
}
21+
],
22+
"require-dev": {
23+
"pocketmine/pocketmine-mp": "^5.0.0",
24+
"sof3/pharynx": "dev-master",
25+
"phpstan/phpstan": "1.12.7"
26+
},
27+
"scripts": {
28+
"lint": [
29+
"./vendor/bin/phpstan analyse --no-progress"
30+
],
31+
"build": [
32+
"composer lint",
33+
"@php -dphar.readonly=0 ./vendor/bin/pharynx -i . -c -p=DisableLocateBar.phar"
34+
]
35+
}
36+
}

0 commit comments

Comments
 (0)