Skip to content

Commit

Permalink
Merge branch 'main' into wangjue-define-comp-router
Browse files Browse the repository at this point in the history
  • Loading branch information
likui628 committed Aug 7, 2024
2 parents 127fa2c + a9a14fd commit 0dbe66f
Show file tree
Hide file tree
Showing 166 changed files with 2,191 additions and 1,845 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ body:
label: Version
description: What version of our software are you running?
options:
- Vben Admin Pro
- Vben Admin
- Vben Admin V5
- Vben Admin V2
default: 0
validations:
required: true
Expand Down
40 changes: 40 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Setup Node"

description: "Setup node and pnpm"

runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: "pnpm"

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
if: ${{ github.ref_name == 'main' }}
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: actions/cache/restore@v4
if: ${{ github.ref_name != 'main' }}
with:
path: ${{ env.STORE_PATH }}
key: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
24 changes: 8 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

jobs:
post-update:
# if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -28,22 +29,13 @@ jobs:

- name: Checkout out pull request
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Test and Build
- name: Build
run: |
pnpm run build
19 changes: 3 additions & 16 deletions .github/workflows/changeset-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,14 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Create Release Pull Request
uses: changesets/action@v1
Expand All @@ -52,4 +39,4 @@ jobs:
commit: "chore: bump versions"
title: "chore: bump versions"
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68 changes: 16 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
push:
branches:
- main
- master
- "releases/*"

permissions:
Expand All @@ -22,11 +21,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20]
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
- macos-latest
- windows-latest
timeout-minutes: 20
steps:
- name: Checkout code
Expand All @@ -39,27 +37,8 @@ jobs:
with:
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Find pnpm store path
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Node
uses: ./.github/actions/setup-node

# - name: Check Git version
# run: git --version
Expand All @@ -81,63 +60,48 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20]
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
- macos-latest
- windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Lint
run: pnpm run lint

check:
name: Check
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
matrix:
node-version: [20]
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Typecheck
run: pnpm check:type

# From https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
- name: Check workflow files
if: runner.os == 'Linux'
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -shellcheck=""
Expand Down
19 changes: 3 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ on:
jobs:
deploy-push-ftp:
name: Deploy Push Ftp
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && contains(github.event.head_commit.message, '[deploy]')
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -33,17 +29,8 @@ jobs:
sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-naive/.env.production
cat ./apps/web-naive/.env.production
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Build
run: pnpm run build
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ on:

permissions:
contents: read
pull-requests: write

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@master
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion .github/workflows/issue-close-require.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
schedule:
- cron: "0 0 * * *"

permissions:
pull-requests: write
contents: write

jobs:
close-issues:
runs-on: ubuntu-latest
Expand All @@ -16,6 +20,6 @@ jobs:
uses: actions-cool/issues-helper@v3
with:
actions: "close-issues" # 执行动作:关闭 Issues
token: ${{ secrets.ACCESS_TOKEN }} # GitHub Token,用于认证
token: ${{ secrets.GITHUB_TOKEN }} # GitHub Token,用于认证
labels: "need reproduction" # 目标标签
inactive-day: 3 # 未活动天数阈值
11 changes: 8 additions & 3 deletions .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
# pull_request:
# types: [labeled]

permissions:
issues: write
pull-requests: write
contents: write

jobs:
reply-labeled:
runs-on: ubuntu-latest
Expand All @@ -15,7 +20,7 @@ jobs:
uses: actions-cool/issues-helper@v3
with:
actions: "remove-labels"
token: ${{ secrets.ACCESS_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: "enhancement: pending triage"

Expand All @@ -24,7 +29,7 @@ jobs:
uses: actions-cool/issues-helper@v3
with:
actions: "remove-labels"
token: ${{ secrets.ACCESS_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: "bug: pending triage"

Expand All @@ -33,7 +38,7 @@ jobs:
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment, remove-labels"
token: ${{ secrets.ACCESS_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide the complete reproduction steps and code. Issues labeled by `needs reproduction` will be closed if no activities in 3 days.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: dessant/lock-threads@v5
with:
github-token: ${{ secrets.ACCESS_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-inactive-days: "30"
issue-lock-reason: ""
pr-inactive-days: "30"
Expand Down
Loading

0 comments on commit 0dbe66f

Please sign in to comment.