From 06d8040dbd85d6398d33b971db54e21b355467ef Mon Sep 17 00:00:00 2001 From: snusxd Date: Mon, 13 Apr 2026 21:41:48 +0300 Subject: [PATCH] feat: add Gitea workflow for sprite sorting and artifact management --- {.github => .gitea}/workflows/main.yml | 42 ++++++++++++-------------- 1 file changed, 19 insertions(+), 23 deletions(-) rename {.github => .gitea}/workflows/main.yml (56%) diff --git a/.github/workflows/main.yml b/.gitea/workflows/main.yml similarity index 56% rename from .github/workflows/main.yml rename to .gitea/workflows/main.yml index 4f85499..bc80a6b 100644 --- a/.github/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -7,7 +7,7 @@ on: - "scripts/**" concurrency: - group: sorting-${{ github.ref }} + group: sorting-${{ gitea.ref }} cancel-in-progress: true permissions: @@ -15,7 +15,7 @@ permissions: jobs: run-scripts: - if: github.actor != 'github-actions[bot]' + if: gitea.actor != 'gitea-actions' runs-on: ubuntu-latest steps: @@ -23,47 +23,45 @@ jobs: uses: actions/checkout@v4 - name: setup node + npm cache - uses: actions/setup-node@v6 + uses: actions/setup-node@v4 with: node-version: "20" cache: "npm" - cache-dependency-path: ./package-lock.json + cache-dependency-path: package-lock.json - name: npm ci - working-directory: ./scripts - run: npm ci --no-audit --no-fund + run: npm ci - name: setup python + pip cache - uses: actions/setup-python@v6 + uses: actions/setup-python@v5 with: python-version: "3.13" cache: "pip" - cache-dependency-path: ./requirements.txt + cache-dependency-path: requirements.txt - name: install python deps - working-directory: ./scripts 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 + npx tsx write.ts && npx tsx sort.ts && npx tsx unready.ts - - name: commit changes (exclude sorted) + - name: commit changes run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" + 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 - 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 - name: upload sorted - uses: actions/upload-artifact@v4 + uses: christopherhx/gitea-upload-artifact@v4 with: name: sorted path: ./_sprites/sorted @@ -71,14 +69,12 @@ jobs: compression-level: 0 - name: upload sorted-merged - uses: actions/upload-artifact@v4 + uses: christopherhx/gitea-upload-artifact@v4 with: name: sorted-merged path: ./_sprites/sorted-merged - retention-days: 15 + retention-days: 45 compression-level: 0 - - name: remove temp sorted folder - run: | - rm -rf ./_sprites/sorted - rm -rf ./_sprites/sorted-merged + - name: cleanup + run: rm -rf ./_sprites/sorted ./_sprites/sorted-merged