Test
This commit is contained in:
31
.github/workflows/minify.yml
vendored
31
.github/workflows/minify.yml
vendored
@@ -33,40 +33,29 @@ jobs:
|
|||||||
|
|
||||||
- name: Combine and Minify Lua files
|
- name: Combine and Minify Lua files
|
||||||
run: |
|
run: |
|
||||||
set -x # Enable debug output
|
|
||||||
|
|
||||||
echo "Creating release directory"
|
|
||||||
mkdir -p release
|
mkdir -p release
|
||||||
|
|
||||||
echo "Creating and populating project.lua"
|
echo "Testing main.lua minification only..."
|
||||||
{
|
if npx luamin -f src/main.lua > release/main.min.lua; then
|
||||||
echo "local project = {}"
|
echo "Main.lua minification successful"
|
||||||
find src -name '*.lua' -exec cat {} \;
|
|
||||||
} > release/project.lua
|
|
||||||
|
|
||||||
echo "Content of project.lua:"
|
|
||||||
cat release/project.lua
|
|
||||||
|
|
||||||
echo "Attempting minification..."
|
|
||||||
if npx luamin -f release/project.lua > release/project.min.lua; then
|
|
||||||
echo "Minification successful"
|
|
||||||
echo "Minified content size: $(wc -c < release/project.min.lua) bytes"
|
|
||||||
else
|
else
|
||||||
echo "Minification failed"
|
echo "Lua syntax check failed. Trying to identify the error:"
|
||||||
|
# Versuche den Lua-Code zu parsen um Syntax-Fehler zu finden
|
||||||
|
luac -p src/main.lua || echo "Lua syntax error detected"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Commit minified Lua file
|
- name: Commit minified Lua file
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
if [ -s release/project.min.lua ]; then
|
if [ -s release/main.min.lua ]; then
|
||||||
git config --global user.name 'github-actions[bot]'
|
git config --global user.name 'github-actions[bot]'
|
||||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||||
git add release/project.min.lua
|
git add release/main.min.lua
|
||||||
git commit -m 'Minify Lua files into a single project.min.lua'
|
git commit -m 'Minify main.lua'
|
||||||
git push
|
git push
|
||||||
else
|
else
|
||||||
echo "Error: project.min.lua is empty or doesn't exist"
|
echo "Error: main.min.lua is empty or doesn't exist"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -112,5 +112,6 @@ function basalt.run(isActive)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
basalt.autoUpdate = basalt.run
|
||||||
|
|
||||||
return basalt
|
return basalt
|
||||||
Reference in New Issue
Block a user