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

View File

@@ -7,7 +7,7 @@ on:
- "scripts/**" - "scripts/**"
concurrency: concurrency:
group: sorting-${{ github.ref }} group: sorting-${{ gitea.ref }}
cancel-in-progress: true cancel-in-progress: true
permissions: permissions:
@@ -15,7 +15,7 @@ permissions:
jobs: jobs:
run-scripts: run-scripts:
if: github.actor != 'github-actions[bot]' if: gitea.actor != 'gitea-actions'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -23,47 +23,45 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: setup node + npm cache - name: setup node + npm cache
uses: actions/setup-node@v6 uses: actions/setup-node@v4
with: with:
node-version: "20" node-version: "20"
cache: "npm" cache: "npm"
cache-dependency-path: ./package-lock.json cache-dependency-path: package-lock.json
- name: npm ci - name: npm ci
working-directory: ./scripts run: npm ci
run: npm ci --no-audit --no-fund
- name: setup python + pip cache - name: setup python + pip cache
uses: actions/setup-python@v6 uses: actions/setup-python@v5
with: with:
python-version: "3.13" python-version: "3.13"
cache: "pip" cache: "pip"
cache-dependency-path: ./requirements.txt cache-dependency-path: requirements.txt
- name: install python deps - name: install python deps
working-directory: ./scripts
run: pip install -r requirements.txt run: pip install -r requirements.txt
- name: scripts - name: scripts
working-directory: ./scripts working-directory: ./scripts
run: | run: |
rm -rf ../_sprites/unready rm -rf ../_sprites/unready
npx tsx write.ts npx tsx write.ts && npx tsx sort.ts && npx tsx unready.ts
npx tsx sort.ts
npx tsx unready.ts
- name: commit changes (exclude sorted) - name: commit changes
run: | run: |
git config --local user.email "action@github.com" git config --local user.email "actions@gitea.local"
git config --local user.name "GitHub Action" git config --local user.name "Gitea Actions"
git add -A . git add -A .
# reset prevents huge artifact folders from being pushed back
git reset _sprites/sorted git reset _sprites/sorted
git reset _sprites/sorted-merged git reset _sprites/sorted-merged
git commit -m "actions commit" || exit 0 # [skip ci] prevents recursive pipeline runs
git commit -m "Auto-sort sprites [skip ci]" || exit 0
git push git push
- name: upload sorted - name: upload sorted
uses: actions/upload-artifact@v4 uses: christopherhx/gitea-upload-artifact@v4
with: with:
name: sorted name: sorted
path: ./_sprites/sorted path: ./_sprites/sorted
@@ -71,14 +69,12 @@ jobs:
compression-level: 0 compression-level: 0
- name: upload sorted-merged - name: upload sorted-merged
uses: actions/upload-artifact@v4 uses: christopherhx/gitea-upload-artifact@v4
with: with:
name: sorted-merged name: sorted-merged
path: ./_sprites/sorted-merged path: ./_sprites/sorted-merged
retention-days: 15 retention-days: 45
compression-level: 0 compression-level: 0
- name: remove temp sorted folder - name: cleanup
run: | run: rm -rf ./_sprites/sorted ./_sprites/sorted-merged
rm -rf ./_sprites/sorted
rm -rf ./_sprites/sorted-merged