@@ -23,48 +23,33 @@ permissions:
23
23
statuses : write
24
24
25
25
jobs :
26
- linter :
27
- runs-on : ubuntu-latest
28
- steps :
29
- - uses : actions/checkout@v3
30
- - uses : leafo/gh-actions-lua@v8.0.0
31
- with :
32
- luaVersion : " 5.2"
33
- - uses : leafo/gh-actions-luarocks@v4.0.0
34
- - run : |
35
- luarocks install luafilesystem
36
- luarocks install argparse
37
- - uses : actions/checkout@v3
38
- with :
39
- repository : LiliaFramework/GluaCheck
40
- path : luacheck
41
- - run : |
42
- cd luacheck
43
- luarocks make
44
- - run : |
45
- luacheck gamemode \
46
- --no-global \
47
- --no-max-line-length \
48
- --no-self \
49
- --no-max-code-line-length \
50
- --no-max-string-line-length \
51
- --no-max-comment-line-length \
52
- --no-max-cyclomatic-complexity
53
-
54
26
strip-comments :
55
- needs : linter
56
27
runs-on : ubuntu-latest
57
28
steps :
58
29
- uses : actions/checkout@v3
59
30
- run : |
60
31
curl -sSfL https://raw.githubusercontent.com/bleonheart/Useful-Python-Scripts/refs/heads/main/files/remove_lua_comments.py -o remove_lua_comments.py || curl -sSfL https://raw.githubusercontent.com/bleonheart/Useful-Python-Scripts/main/files/remove_lua_comments.py -o remove_lua_comments.py
61
32
python3 remove_lua_comments.py gamemode
33
+ tar --exclude=.git -cf workspace.tar .
34
+ - uses : actions/upload-artifact@v4
35
+ with :
36
+ name : workspace
37
+ path : workspace.tar
38
+ overwrite : true
39
+ retention-days : 1
62
40
63
41
format-glua :
64
42
needs : strip-comments
65
43
runs-on : ubuntu-latest
66
44
steps :
67
45
- uses : actions/checkout@v3
46
+ - uses : actions/download-artifact@v4
47
+ with :
48
+ name : workspace
49
+ path : .
50
+ - run : |
51
+ tar -xf workspace.tar
52
+ rm -f workspace.tar
68
53
- name : Download glualint binary
69
54
env :
70
55
GLUALINT_VERSION : " 1.29.0"
@@ -87,15 +72,58 @@ jobs:
87
72
- name : Pretty-print all Lua files
88
73
run : |
89
74
find . -type f -name "*.lua" -print0 | xargs -0 ./glualint --pretty-print-files
90
- - name : Commit changes
91
- run : |
92
- if [ -n "$(git status --porcelain)" ]; then
93
- git config user.name "github-actions[bot]"
94
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
95
- git add .
96
- git commit -m "chore: auto-format all GLua files"
97
- git push
98
- fi
75
+ tar --exclude=.git -cf workspace.tar .
76
+ - uses : actions/upload-artifact@v4
77
+ with :
78
+ name : workspace
79
+ path : workspace.tar
80
+ overwrite : true
81
+ retention-days : 1
82
+
83
+ linter :
84
+ needs : format-glua
85
+ runs-on : ubuntu-latest
86
+ steps :
87
+ - uses : actions/checkout@v3
88
+ - uses : actions/download-artifact@v4
89
+ with :
90
+ name : workspace
91
+ path : .
92
+ - run : |
93
+ tar -xf workspace.tar
94
+ rm -f workspace.tar
95
+ - uses : leafo/gh-actions-lua@v8.0.0
96
+ with :
97
+ luaVersion : " 5.2"
98
+ - uses : leafo/gh-actions-luarocks@v4.0.0
99
+ - run : |
100
+ luarocks install luafilesystem
101
+ luarocks install argparse
102
+ - uses : actions/checkout@v3
103
+ with :
104
+ repository : LiliaFramework/GluaCheck
105
+ path : luacheck
106
+ - run : |
107
+ cd luacheck
108
+ luarocks make
109
+ - run : |
110
+ luacheck gamemode \
111
+ --no-global \
112
+ --no-max-line-length \
113
+ --no-self \
114
+ --no-max-code-line-length \
115
+ --no-max-string-line-length \
116
+ --no-max-comment-line-length \
117
+ --no-max-cyclomatic-complexity
118
+ - run : |
119
+ cd "${GITHUB_WORKSPACE}"
120
+ tar --exclude=.git -cf workspace.tar .
121
+ - uses : actions/upload-artifact@v4
122
+ with :
123
+ name : workspace
124
+ path : workspace.tar
125
+ overwrite : true
126
+ retention-days : 1
99
127
100
128
compute-version :
101
129
if : github.repository == 'LiliaFramework/Lilia'
@@ -134,6 +162,13 @@ jobs:
134
162
- uses : actions/checkout@v3
135
163
with :
136
164
fetch-depth : 0
165
+ - uses : actions/download-artifact@v4
166
+ with :
167
+ name : workspace
168
+ path : .
169
+ - run : |
170
+ tar -xf workspace.tar
171
+ rm -f workspace.tar
137
172
- run : |
138
173
python3 - << 'PY'
139
174
import os, re, pathlib, sys
@@ -158,17 +193,17 @@ jobs:
158
193
mkdir -p documentation/docs/versioning
159
194
echo "{\"version\":\"${VERSION}\"}" > documentation/docs/versioning/lilia.json
160
195
- run : |
161
- git config user.name github-actions[bot]
162
- git config user.email github-actions[bot]@users.noreply.github.com
163
- git add gamemode/shared.lua documentation/docs/versioning/lilia.json
164
- git diff-index --quiet HEAD || git commit -m "Successfully updated workshop Lilia to ${VERSION}"
165
- git push origin HEAD:main
196
+ git config user.name "github-actions[bot]"
197
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
198
+ git add -A
199
+ if ! git diff --cached --quiet; then
200
+ git commit -m "chore: Successfully updated workshop Lilia to ${VERSION}"
201
+ git push origin HEAD:main
202
+ fi
166
203
167
204
release :
168
205
if : github.repository == 'LiliaFramework/Lilia' && github.ref == 'refs/heads/main'
169
- needs :
170
- - compute-version
171
- - update-shared-version
206
+ needs : update-shared-version
172
207
runs-on : ubuntu-latest
173
208
env :
174
209
VERSION : ${{ needs.compute-version.outputs.version }}
@@ -283,9 +318,7 @@ jobs:
283
318
284
319
deploy-pages :
285
320
if : github.repository == 'LiliaFramework/Lilia' && github.ref == 'refs/heads/main'
286
- needs :
287
- - compute-version
288
- - release
321
+ needs : release
289
322
runs-on : ubuntu-latest
290
323
env :
291
324
VERSION : ${{ needs.compute-version.outputs.version }}
0 commit comments