feat: migrate to turbo (#22)

* feat: migrate top turbo

* ci: ci test

* fix: fix codeql issues

* feat: ci test

* chore: lint

* chore: misc changes

* feat: rename vite helpers

* feat: use fetch to handle assets

* feat: update directory

* feat: fetch charword table

* feat: migrate download game data and detect missing voice files

* feat: symlink relative path

* feat: finish wrangler upload

* feat: migrate wrangler download

* feat: finish

* chore: auto update

* ci: update ci

* ci: update ci

---------

Co-authored-by: Halyul <Halyul@users.noreply.github.com>
This commit is contained in:
Haoyu Xu
2025-02-22 15:11:30 +08:00
committed by GitHub
parent 17c61ce5d4
commit d6e7bc20d3
352 changed files with 12911 additions and 9411 deletions

View File

@@ -3,12 +3,12 @@ name: Build release and push to CF Pages
on:
push:
branches: [ main ]
pull_request:
branches:
- main
env:
CACHE_ZIP_FILENAME: cache.zip
ASSETS_FOLDER: data/operator
RELEASE_FOLDER: release
CACHE_BASE_KEY: akassets
DO_NOT_TRACK: 1
jobs:
build:
@@ -19,42 +19,15 @@ jobs:
uses: pnpm/action-setup@v4
with:
run_install: true
- name: Restore cached assets
id: cache-akassets-restore
uses: actions/cache@v4
with:
path: |
${{ env.CACHE_ZIP_FILENAME }}
key: ${{ env.CACHE_BASE_KEY }}-${{ hashFiles('offical_update.json') }}
restore-keys: |
${{ env.CACHE_BASE_KEY }}
- name: Unzip assets
run: |
if test -f ${{ env.CACHE_ZIP_FILENAME }}; then
unzip -qq ${{ env.CACHE_ZIP_FILENAME }} -d .
fi
shell: bash
- name: Download Assets
run: pnpm run cf:download
- name: Build all
run: pnpm run operator:build-all
timeout-minutes: 10
- name: Build directory
run: pnpm run directory:build
- name: Download Data
run: pnpm run download:data
- name: Build
run: pnpm run build
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: aklive2d
directory: ${{ env.RELEASE_FOLDER}}
directory: dist
wranglerVersion: '3'
- name: Zip assets
run: zip -qq -9 -r ${{ env.CACHE_ZIP_FILENAME }} ${{ env.ASSETS_FOLDER }}
- name: Save assets
id: cache-akassets-save
uses: actions/cache/save@v4
with:
path: |
${{ env.CACHE_ZIP_FILENAME }}
key: ${{ env.CACHE_BASE_KEY }}-${{ hashFiles('offical_update.json') }}

View File

@@ -1,32 +0,0 @@
name: Update charwords
on:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Use PNPM
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install dependencies
run: pnpm i
- name: Update charwords
run: pnpm run charwords:update
- name: Commit changes if any
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore(charwords): auto update"

View File

@@ -1,32 +0,0 @@
name: Update music
on:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Use PNPM
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install dependencies
run: pnpm i
- name: Update music mapping
run: pnpm run music
- name: Commit changes if any
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore(music): auto update mapping"

View File

@@ -1,32 +0,0 @@
name: Update Offical Dyn Info
on:
schedule:
- cron: '30 10 * * *'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Use PNPM
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install dependencies
run: pnpm i
- name: Update offical dyn info
run: pnpm run offical_update
- name: Commit changes if any
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore(offical update): auto update"

32
.github/workflows/update.yaml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Update
env:
DO_NOT_TRACK: 1
on:
schedule:
- cron: '30 10 * * *'
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Use PNPM
uses: pnpm/action-setup@v4
with:
run_install: true
- name: Update
run: pnpm run update
- name: Commit changes if any
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: auto update"