Skip to content

Commit 967fd2f

Browse files
committed
PluginTemplate からファイルをコピー
1 parent 7f93972 commit 967fd2f

File tree

3 files changed

+50
-37
lines changed

3 files changed

+50
-37
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/release.yml

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

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# IDEs
44
.idea/
55
nbproject/
6-
.vscode/**
7-
!.vscode/settings.json
6+
.vscode/
7+
.editorconfig
88

99
# Windows
1010
Thumbs.db

0 commit comments

Comments
 (0)