From 454c39c4836b45aac9e9c71d9ce643878cd1b97c Mon Sep 17 00:00:00 2001 From: p2vman Date: Wed, 14 May 2025 05:40:48 +0000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.gitea/workflows/minify-lua.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/minify-lua.yml | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitea/workflows/minify-lua.yml diff --git a/.gitea/workflows/minify-lua.yml b/.gitea/workflows/minify-lua.yml new file mode 100644 index 0000000..71d0ed3 --- /dev/null +++ b/.gitea/workflows/minify-lua.yml @@ -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