feat: 自动生成 README 脚本列表表格 #15
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: Build & Publish UserScripts | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'src/**' | |
| - 'scripts/**' | |
| - 'packages/**' | |
| - 'package.json' | |
| - 'bun.lock' | |
| - 'tsconfig.json' | |
| - '.github/workflows/**' | |
| # 允许手动触发 | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - run: bun install --frozen-lockfile | |
| - run: cd packages/components && bun install | |
| - run: bun run typecheck | |
| - name: Build component library | |
| run: cd packages/components && bun run build | |
| - run: bun run build | |
| # 生成同步清单(供调试和 Webhook 使用) | |
| - name: Generate sync manifest | |
| run: bun run manifest | |
| # 部署 dist/ 到 gh-pages 分支 | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./dist | |
| # 不保留历史,每次全量替换 | |
| keep_files: false |