chore: reset repository history

This commit is contained in:
xixu-me committed 2026-03-21 18:51:02 +08:00
commit d528ce9578
59 files changed
+21559

No files matched your search

+95
View File
@@ -0,0 +1,95 @@
name: CI
on:
pull_request:
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.editorconfig'
- '.gitattributes'
- '.gitignore'
- '.prettierignore'
- '.prettierrc'
- 'codecov.yml'
push:
branches:
- main
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.editorconfig'
- '.gitattributes'
- '.gitignore'
- '.prettierignore'
- '.prettierrc'
- 'codecov.yml'
merge_group:
workflow_dispatch:
permissions:
contents: read
id-token: write
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BUN_VERSION: 1.3.11
jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Check formatting
run: bun run format:check
- name: Check TypeScript
run: bun run check
- name: Check generated Wrangler types
run: bunx wrangler types --check
- name: Run tests with coverage
run: bun run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage/lcov.info
fail_ci_if_error: true
use_oidc: true
deploy-dry-run:
needs:
- quality
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build deployment bundle without publishing
run: bunx wrangler deploy --dry-run --keep-vars --message "CI dry run for ${GITHUB_SHA}"
@@ -0,0 +1,64 @@
name: Dependabot Auto Merge
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.editorconfig'
- '.gitattributes'
- '.gitignore'
- '.prettierignore'
- '.prettierrc'
- 'codecov.yml'
permissions:
contents: write
pull-requests: write
concurrency:
group: dependabot-automerge-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
enable:
if: >
github.actor == 'dependabot[bot]' &&
github.event.pull_request.user.login == 'dependabot[bot]' &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Approve safe update when repository settings allow it
if: >
contains(fromJSON('["version-update:semver-patch","version-update:semver-minor"]'), steps.metadata.outputs.update-type) ||
(steps.metadata.outputs.update-type == 'version-update:semver-major' &&
(steps.metadata.outputs.package-ecosystem == 'github-actions' ||
steps.metadata.outputs.dependency-type == 'direct:development'))
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: gh pr review --approve "$PR_URL" --body "Safe Dependabot update approved for auto-merge."
- name: Enable auto-merge for safe update
if: >
contains(fromJSON('["version-update:semver-patch","version-update:semver-minor"]'), steps.metadata.outputs.update-type) ||
(steps.metadata.outputs.update-type == 'version-update:semver-major' &&
(steps.metadata.outputs.package-ecosystem == 'github-actions' ||
steps.metadata.outputs.dependency-type == 'direct:development'))
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: gh pr merge --auto --merge "$PR_URL"
+66
View File
@@ -0,0 +1,66 @@
name: Deploy
on:
workflow_run:
workflows:
- CI
types:
- completed
branches:
- main
workflow_dispatch:
permissions:
contents: read
deployments: write
concurrency:
group: deploy-production
cancel-in-progress: false
env:
BUN_VERSION: 1.3.11
jobs:
deploy:
if: >
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'main')
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out the revision that passed CI
uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Verify deployment credentials
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: |
if [ -z "$CLOUDFLARE_ACCOUNT_ID" ]; then
echo "CLOUDFLARE_ACCOUNT_ID secret is required for deployment." >&2
exit 1
fi
if [ -z "$CLOUDFLARE_API_TOKEN" ]; then
echo "CLOUDFLARE_API_TOKEN secret is required for deployment." >&2
exit 1
fi
- name: Deploy to Cloudflare Workers
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: bunx wrangler deploy --keep-vars --message "GitHub Actions deploy for ${GITHUB_SHA}"