forked from PhantomBot/PhantomBot
-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (200 loc) · 6.14 KB
/
master.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: On Push Actions
on:
push:
branches:
- 'master'
paths-ignore:
- 'docs/**'
- 'resources/java-runtime**'
jobs:
updateremotepanel:
name: Update Remote Panel
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Copy Files
run: |
echo ::group::update docs/panel/
rm -rf docs/panel/
cp -rv resources/web/panel docs
echo ::endgroup::
echo ::group::update docs/common/
rm -rf docs/common/
cp -rv resources/web/common docs
echo ::endgroup::
- name: Make Path File
run: |
echo docs/panel/ >> paths.txt
echo docs/common/ >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docsremotepanel
path: |
docs/common/**
docs/panel/**
paths.txt
if-no-files-found: error
retention-days: 1
parsecommandtags:
name: Parse Command Tags on ubuntu-latest with Python 3.x
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Execute Script
run: python3 development-resources/parse_transformers.py
- name: Make Path File
run: |
echo docs/guides/content/commands/command-variables.md >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docstransformers
path: |
docs/guides/content/commands/command-variables.md
paths.txt
if-no-files-found: error
retention-days: 1
parseconsolecommands:
name: Parse Console Commands on ubuntu-latest with Python 3.x
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Execute Script
run: python3 development-resources/parse_consolecommands.py
- name: Make Path File
run: |
echo docs/guides/content/commands/console-commands.md >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docsconsolecommands
path: |
docs/guides/content/commands/console-commands.md
paths.txt
if-no-files-found: error
retention-days: 1
parsebotproperties:
name: Parse Bot Properties on ubuntu-latest with Python 3.x
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Execute Script
run: python3 development-resources/parse_botproperties.py
- name: Make Path File
run: |
echo docs/guides/content/setupbot/properties.md >> paths.txt
echo resources/web/common/json/properties.json >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docsbotproperties
path: |
docs/guides/content/setupbot/properties.md
resources/web/common/json/properties.json
paths.txt
if-no-files-found: error
retention-days: 1
javadoc:
name: Generate JavaDoc on ubuntu-latest
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Set up Ant
run: sudo apt-get install ant
- name: Backup Zips
continue-on-error: true
run: mkdir -p /tmp/javadoczips && cp -fv docs/javadoc/*.zip /tmp/javadoczips/
- name: Retrieve Libs with Ant
run: ant -noinput -buildfile build.xml ivy-retrieve
- name: JavaDoc with Ant
run: ant -noinput -buildfile build.xml javadoc
- name: Execute Script
run: python3 development-resources/clean_javadoc.py
- name: Copy Files
run: |
echo ::group::update docs/javadoc/
rm -rf docs/javadoc/
cp -rv dist/javadoc docs
echo ::endgroup::
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: |
docs/javadoc/**
!docs/javadoc/*.zip
- name: Revert Zips
continue-on-error: true
if: steps.verify-changed-files.outputs.files_changed == 'false'
run: cp -fv /tmp/javadoczips/*.zip docs/javadoc/
- name: Make Path File
run: |
echo docs/javadoc/ >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docsjavadoc
path: |
docs/javadoc/**
paths.txt
if-no-files-found: error
retention-days: 1
commit:
name: Commit Docs
runs-on: ubuntu-latest
needs: [updateremotepanel, parsecommandtags, parseconsolecommands, parsebotproperties, javadoc]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: 'master'
- name: Prep Artifact Dir
run: mkdir -p /tmp/docartifacts
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: /tmp/docartifacts
- name: Copy Files
run: for d in /tmp/docartifacts/docs*; do while read p; do echo ::group::update $p; rm -rf $p; cp -rv $d/$p $p; echo ::endgroup::; done < $d/paths.txt; done
- name: Commit Changes
uses: EndBug/add-and-commit@v9
with:
message: Updated GitHub Pages
default_author: github_actions