73 lines
1.9 KiB
YAML
73 lines
1.9 KiB
YAML
name: Generate Documentation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'src/**'
|
|
- '**.lua'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'src/**'
|
|
- '**.lua'
|
|
|
|
jobs:
|
|
docs:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Lua and LDoc
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y lua5.3 \
|
|
lua5.3-dev \
|
|
liblua5.3-dev \
|
|
luarocks \
|
|
build-essential \
|
|
libreadline-dev
|
|
|
|
# Konfiguriere LuaRocks für Lua 5.3
|
|
sudo luarocks --lua-version=5.3 install ldoc
|
|
|
|
# Verifiziere Installation
|
|
ldoc --version || exit 1
|
|
|
|
- name: Generate Documentation
|
|
run: |
|
|
# Erstelle config.ld wenn nicht vorhanden
|
|
if [ ! -f "config.ld" ]; then
|
|
echo 'project="Basalt2"; title="Basalt2 Documentation"; description="A powerful UI Framework for ComputerCraft"; dir="docs"; style="!pale"; format="markdown"; file="src"; examples={"examples"}; all=true; template=true' > config.ld
|
|
fi
|
|
|
|
echo "LDoc Konfiguration:"
|
|
cat config.ld
|
|
|
|
echo "Verfügbare Lua-Dateien:"
|
|
find src -name "*.lua" -type f
|
|
|
|
# Generiere Dokumentation
|
|
ldoc . --verbose
|
|
|
|
# Prüfe ob Docs generiert wurden
|
|
if [ ! -d "docs" ]; then
|
|
echo "Documentation generation failed"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Commit documentation
|
|
if: success()
|
|
run: |
|
|
git config --global user.name 'github-actions[bot]'
|
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
|
git add docs/
|
|
git commit -m 'Update documentation'
|
|
git push
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|