mirror of
https://github.com/ant-design/ant-design-cli.git
synced 2026-09-14 19:07:15 +08:00
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Sync antd data
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '37 * * * *' # Hourly at :37
|
|
workflow_dispatch: # Manual trigger
|
|
|
|
concurrency:
|
|
group: sync-antd-data
|
|
cancel-in-progress: false
|
|
|
|
permissions:
|
|
contents: write
|
|
id-token: write # npm OIDC Trusted Publishing + provenance
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- run: npm ci
|
|
|
|
- name: Check if sync needed
|
|
id: check-version
|
|
run: npx tsx scripts/check-sync-needed.ts
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
- name: Baseline test (before data sync)
|
|
if: steps.check-version.outputs.needs_publish == 'true'
|
|
run: npm run build && npm test
|
|
|
|
- name: Clone antd repo (shallow, filter tree)
|
|
if: steps.check-version.outputs.needs_sync == 'true'
|
|
run: |
|
|
git clone --filter=tree:0 --no-checkout \
|
|
https://github.com/ant-design/ant-design.git antd-source
|
|
|
|
- name: Sync v4, v5, v6 metadata
|
|
if: steps.check-version.outputs.needs_sync == 'true'
|
|
run: npx tsx scripts/sync.ts --antd-dir antd-source
|
|
|
|
- name: Validate synced data
|
|
if: steps.check-version.outputs.needs_sync == 'true'
|
|
run: npx tsx scripts/validate-data.ts --quiet
|
|
|
|
- name: Build and publish
|
|
if: steps.check-version.outputs.needs_publish == 'true'
|
|
run: npx tsx scripts/publish.ts
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|