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+ 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+ 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+ 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
0 commit comments