Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
uses: actions/checkout@v7
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
persist-credentials: false

Expand All @@ -48,15 +48,23 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
persist-credentials: false

- name: Setup Node.js
uses: ./.github/actions/setup-node

- name: Restore ESLint cache
uses: actions/cache@v6
with:
path: .eslintcache
key: eslint-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'package.json', 'eslint.config.ts') }}-${{ github.sha }}
restore-keys: |
eslint-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'package.json', 'eslint.config.ts') }}-

- name: 🌡️ Run ESLint
run: pnpm lint --quiet
run: pnpm lint --quiet --cache --cache-location .eslintcache

typecheck:
runs-on: ubuntu-latest
Expand All @@ -66,7 +74,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
persist-credentials: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ jobs:
printf '%s\n' "$PR_STATE" > ./pr-state.txt

- name: Upload PR number
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: pr-id
path: ./pr-id.txt

- name: Upload PR ref
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: pr-ref
path: ./pr-ref.txt

- name: Upload PR repo
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: pr-repo
path: ./pr-repo.txt

- name: Upload PR state
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: pr-state
path: ./pr-state.txt
128 changes: 128 additions & 0 deletions .github/workflows/deploy-github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: 🌐 Deploy to GitHub Pages

on:
push:
branches: [dev]
tags:
- 'v*.*.*'
- 'v*.*.*-alpha.*'
- 'v*.*.*-beta.*'
- 'v*.*.*-rc.*'

concurrency:
group: github-pages
cancel-in-progress: false

permissions:
contents: write
pull-requests: read

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false

- name: Setup Node.js
uses: ./.github/actions/setup-node

# ================= Deploy Demo =================
- name: 📦 Build demo
run: pnpm build:demo

- name: Copy demo to workspace
run: |
mkdir -p dist
cp -r ./examples/local/* dist

- name: 📦 Build react16 demo
run: |
pnpm use:react16
pnpm build:demo

- name: Copy react16 demo
run: |
mkdir -p dist/react16
cp -r ./examples/local/* dist/react16

# ================= Deploy Storybook =================
- name: 📦 Build storybook
run: pnpm storybook:build

- name: Copy storybook
run: |
mkdir -p dist/storybook
cp -r ./common/storybook/storybook-static/* dist/storybook

- name: Checkout existing Pages branch
uses: actions/checkout@v7
continue-on-error: true
with:
ref: gh-pages
path: gh-pages-current
persist-credentials: false

- name: Preserve recent PR previews
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ ! -d gh-pages-current/pr-preview ]; then
exit 0
fi

mkdir -p dist/pr-preview
cutoff_epoch=$(date -u -d '30 days ago' +%s)
shopt -s nullglob

for preview_dir in gh-pages-current/pr-preview/pr-*; do
pr_number="${preview_dir##*/pr-}"
if [[ ! "$pr_number" =~ ^[0-9]+$ ]]; then
echo "Prune unexpected preview directory: ${preview_dir}"
continue
fi

if ! pr_info=$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${pr_number}" --jq '[.state, (.closed_at // "")] | @tsv' 2>/dev/null); then
echo "Prune preview for missing PR #${pr_number}"
continue
fi

IFS=$'\t' read -r state closed_at <<< "$pr_info"
if [ "$state" = "open" ]; then
echo "Keep preview for open PR #${pr_number}"
cp -a "$preview_dir" "dist/pr-preview/"
continue
fi

if [ -n "$closed_at" ]; then
closed_epoch=$(date -u -d "$closed_at" +%s)
if [ "$closed_epoch" -ge "$cutoff_epoch" ]; then
echo "Keep preview for recently closed PR #${pr_number}"
cp -a "$preview_dir" "dist/pr-preview/"
continue
fi
fi

echo "Prune preview for PR #${pr_number}"
done

- name: Check Pages publish size
run: |
size_kb=$(du -sk dist | awk '{print $1}')
max_kb=950000
echo "Pages publish directory size: ${size_kb} KB"
if [ "$size_kb" -gt "$max_kb" ]; then
echo "Pages publish directory exceeds ${max_kb} KB. Largest entries:"
du -h -d 2 dist | sort -hr | head -50
exit 1
fi

# ================= Deploy to GitHub Pages =================
- name: 🚀 Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
steps:
# Get PR id from artifact
- name: download pr artifact
uses: dawidd6/action-download-artifact@v9
uses: dawidd6/action-download-artifact@v21
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -45,7 +45,7 @@ jobs:

# Get PR ref from artifact
- name: download pr artifact
uses: dawidd6/action-download-artifact@v9
uses: dawidd6/action-download-artifact@v21
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -57,7 +57,7 @@ jobs:

# Get PR repo from artifact
- name: download pr artifact
uses: dawidd6/action-download-artifact@v9
uses: dawidd6/action-download-artifact@v21
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -69,7 +69,7 @@ jobs:

# Get PR state from artifact
- name: download pr state artifact
uses: dawidd6/action-download-artifact@v9
uses: dawidd6/action-download-artifact@v21
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -87,7 +87,7 @@ jobs:
steps:
# ================= Create Comment =================
- name: 🧽 Find And Delete Comment
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v4
if: ${{ needs.setup.outputs.id != '' }}
id: fc
with:
Expand All @@ -96,7 +96,7 @@ jobs:
body-includes: View Deployment

- name: 📝 Create or update comment
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v5
if: ${{ needs.setup.outputs.id != '' }}
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
Expand All @@ -120,19 +120,19 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
repository: ${{ needs.setup.outputs.repo }}
ref: ${{ needs.setup.outputs.ref }}
persist-credentials: false

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v6
with:
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 24.3.0
cache: pnpm
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
steps:
# ================= Create Comment =================
- name: 🧽 Find And Delete Comment
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v4
if: ${{ needs.setup.outputs.id != '' }}
id: fc
with:
Expand All @@ -207,7 +207,7 @@ jobs:
body-includes: View Deployment

- name: 📝 Create or update comment
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v5
if: ${{ needs.setup.outputs.id != '' }}
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev-performance-log.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
persist-credentials: false

Expand All @@ -38,7 +38,7 @@ jobs:
uses: ./.github/actions/setup-node

- name: Cache Playwright browsers
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
Expand Down
Loading
Loading