Skip to content

Update Resource Database #13

Update Resource Database

Update Resource Database #13

name: Update Resource Database
on:
workflow_dispatch:
jobs:
update-resources:
runs-on: ubuntu-latest
steps:
- name: Check out main repo
uses: actions/checkout@v3
with:
token: ${{ secrets.PUSH_KEY }}
- name: Reinstall LuaRocks cleanly with exec support
run: |
sudo apt-get update
sudo apt-get install -y lua5.1 lua5.1-dev libsqlite3-dev build-essential curl unzip
# Download and install LuaRocks with Lua 5.1
curl -L -O https://luarocks.org/releases/luarocks-3.9.2.tar.gz
tar zxpf luarocks-3.9.2.tar.gz
cd luarocks-3.9.2
./configure --lua-version=5.1 --lua-suffix=5.1 --with-lua-include=/usr/include/lua5.1
make
sudo make install
cd ..
# Verify and install sqlite3
luarocks --version
which luarocks
which lua
sudo luarocks install lsqlite3
- name: Clone Windower/Resources outside workspace
run: |
git clone https://github.com/Windower/Resources.git /tmp/resources_data
- name: Run Lua script via luarocks exec
run: |
luarocks exec -- lua resources/scripts/generate_items.lua /tmp/resources_data/items.lua
- name: Configure Git
run: |
git config --global user.name 'cyrite'
git config --global user.email '[email protected]'
- name: Commit and push changes
run: |
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Updating resource database"
git push
else
echo "No changes to commit."
fi