Hitomi DB Build #16
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: Hitomi DB Build | |
| on: | |
| schedule: | |
| - cron: '0 3 * * 1' # UTC Monday 03:00 | |
| workflow_dispatch: | |
| inputs: | |
| force_full: | |
| description: 'Force full scrape (ignore previous errors)' | |
| required: false | |
| default: 'false' | |
| type: boolean | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install Qt runtime libs for smoke test | |
| uses: tlambert03/setup-qt-libs@v1 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Scrape dataset | |
| id: scrape | |
| continue-on-error: true | |
| run: | | |
| uv run python -m utils.website.hitomi.scape_dataset \ | |
| --db-path __temp/hitomi.db \ | |
| --workers 2 \ | |
| --max-retries 5 \ | |
| --timeout 15 | |
| - name: Retry failed (if first attempt had errors) | |
| id: retry | |
| if: steps.scrape.outcome == 'failure' | |
| run: | | |
| uv run python -m utils.website.hitomi.scape_dataset \ | |
| --db-path __temp/hitomi.db \ | |
| --workers 1 \ | |
| --max-retries 8 \ | |
| --timeout 20 \ | |
| --only-failed | |
| - name: Quality gate | |
| run: uv run python .github/scripts/hitomi_db_gate.py __temp/hitomi.db | |
| - name: Generate manifest | |
| run: | | |
| uv run python .github/scripts/generate_hitomi_manifest.py \ | |
| __temp/hitomi.db \ | |
| --output __temp/hitomi-manifest.json | |
| - name: Upload to release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG="preset" | |
| # Upload assets to existing release (or create if not exists) | |
| if gh release view "$TAG" &>/dev/null; then | |
| # Delete old assets then re-upload | |
| gh release delete-asset "$TAG" hitomi.db --yes 2>/dev/null || true | |
| gh release delete-asset "$TAG" hitomi-manifest.json --yes 2>/dev/null || true | |
| gh release upload "$TAG" \ | |
| __temp/hitomi.db \ | |
| __temp/hitomi-manifest.json | |
| else | |
| gh release create "$TAG" \ | |
| --title "Preset Assets" \ | |
| --notes "Auto-managed preset assets (hitomi.db, etc.)" \ | |
| --latest=false \ | |
| __temp/hitomi.db \ | |
| __temp/hitomi-manifest.json | |
| fi |