-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.61 KB
/
release.yml
File metadata and controls
48 lines (40 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Create Release Build
on:
push:
tags:
- '*'
env:
OUTPUT_FILE: ${{ github.event.repository.name }}_v${{ github.ref_name }}.phar
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Change plugin structure from PSR-4 to PSR-0
shell: php {0}
run: |
<?php
$description = yaml_parse_file("plugin.yml");
$path = str_replace("\\", "/", $description["src-namespace-prefix"] ?? exit);
system("mkdir -p _/$path; mv src/* _/$path; rmdir src; mv _ src");
unset($description["src-namespace-prefix"]);
yaml_emit_file("plugin.yml", $description);
- name: Build plugin
run: curl -sL https://raw.githubusercontent.com/pmmp/DevTools/1.17.1/src/ConsoleScript.php | php -dphar.readonly=0 -- --make ./ --out $OUTPUT_FILE
- name: Infect virions
shell: php {0}
run: |
<?php
foreach(@yaml_parse_file(".poggit.yml")["projects"] ?? [] as $project){
foreach($project["libs"] ?? [] as $lib){
$url = "https://poggit.pmmp.io/v.dl/{$lib["src"]}/" . ($lib["version"] ?? "*");
@$lib["branch"] && $url .= "?branch={$lib["branch"]}";
file_put_contents("virion.phar", file_get_contents($url));
system("php -dphar.readonly=0 virion.phar ${{ env.OUTPUT_FILE }}");
}
}
- uses: softprops/action-gh-release@v0.1.15
with:
name: ${{ github.event.repository.name }} ${{ github.ref_name }}
generate_release_notes: true
files: ${{ env.OUTPUT_FILE }}