feat: add Gitea workflow for sprite sorting and artifact management

This commit is contained in:
snusxd
2026-04-13 21:41:48 +03:00
parent caf7ed382d
commit 06d8040dbd

80
.gitea/workflows/main.yml Normal file
View File

@@ -0,0 +1,80 @@
name: sorting
on:
push:
branches: [main]
paths:
- "_sprites/**"
- "scripts/**"
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 + npm cache
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json
- name: npm ci
run: npm ci
- name: setup python + pip cache
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: requirements.txt
- name: install python deps
run: pip install -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