Добавить .gitea/workflows/minify-lua.yml
This commit is contained in:
parent
225355a7bd
commit
454c39c483
|
@ -0,0 +1,42 @@
|
|||
name: Minify Lua
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
minify:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Node.js (для luamin)
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install luamin
|
||||
run: npm install -g luamin
|
||||
|
||||
- name: Create minified branch
|
||||
run: |
|
||||
git config user.name "AutoBot"
|
||||
git config user.email "bot@example.com"
|
||||
|
||||
# Создаём новую ветку от main
|
||||
git checkout -B minified
|
||||
|
||||
# Минифицируем все .lua
|
||||
find . -type f -name "*.lua" | while read -r f; do
|
||||
echo "Minifying $f"
|
||||
luamin -f "$f" > "$f.min" && mv "$f.min" "$f"
|
||||
done
|
||||
|
||||
git add .
|
||||
git commit -m "Auto minify Lua files"
|
||||
git push -f origin minified
|
Loading…
Reference in New Issue