Files
deltasprite/.gitea/workflows/main.yml
snusxd cefb2c0e46
All checks were successful
sorting / run-scripts (push) Successful in 1m35s
refactor: streamline node and python setup steps in workflow
2026-04-13 22:06:52 +03:00

78 lines
1.9 KiB
YAML

name: sorting
on:
push:
branches: [main]
paths:
- "_sprites/**"
- "scripts/**"
- ".gitea/**"
concurrency:
group: sorting-${{ gitea.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
run-scripts:
if: gitea.actor != 'gitea-actions'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: npm ci
run: npm ci --prefer-offline --no-audit --no-fund
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: install python deps
run: pip install --no-cache-dir -r requirements.txt
- name: scripts
working-directory: ./scripts
run: |
rm -rf ../_sprites/unready
npx tsx write.ts && npx tsx sort.ts && npx tsx unready.ts
- name: commit changes
run: |
git config --local user.email "actions@gitea.local"
git config --local user.name "Gitea Actions"
git add -A .
# reset prevents huge artifact folders from being pushed back
git reset _sprites/sorted
git reset _sprites/sorted-merged
# [skip ci] prevents recursive pipeline runs
git commit -m "Auto-sort sprites [skip ci]" || exit 0
git push
- name: upload sorted
uses: christopherhx/gitea-upload-artifact@v4
with:
name: sorted
path: ./_sprites/sorted
retention-days: 15
compression-level: 0
- name: upload sorted-merged
uses: christopherhx/gitea-upload-artifact@v4
with:
name: sorted-merged
path: ./_sprites/sorted-merged
retention-days: 45
compression-level: 0
- name: cleanup
run: rm -rf ./_sprites/sorted ./_sprites/sorted-merged