Update Resource Database #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install Python dependencies | |
run: pip install lupa | |
- name: Clone Windower/Resources outside workspace | |
run: | | |
git clone https://github.com/Windower/Resources.git /tmp/resources_data | |
- name: Run Python script | |
run: | | |
python resources/scripts/generate_items.py /tmp/resources_data/resources_data/items.lua resources/scripts/items.db | |
- name: Configure Git | |
run: | | |
git config --global user.name 'cyrite' | |
git config --global user.email '[email protected]' | |
- name: Commit and push only resources.db | |
run: | | |
if git diff --quiet --exit-code resources/resources.db; then | |
echo "No changes to resources.db" | |
else | |
git add resources/resources.db | |
git commit -m "Updating resource database" | |
git push | |
fi | |