mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-27 22:55:59 +00:00
feat: 初始化前端项目基础结构
- 添加项目配置文件(tsconfig, eslint, prettier等) - 实现基础路由和页面布局 - 添加全局状态管理和API请求封装 - 集成UI组件库和主题系统 - 添加文档网站和示例页面 - 配置CI/CD和工作流
This commit is contained in:
+119
@@ -0,0 +1,119 @@
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.9.0
|
||||
run_install: false
|
||||
|
||||
- name: Get pnpm store directory
|
||||
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 (workspace recursive)
|
||||
run: pnpm -r install --frozen-lockfile
|
||||
|
||||
- name: Test WeChat Mini Program dev mode
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Testing WeChat Mini Program dev mode startup..."
|
||||
timeout 30s pnpm dev:mp-weixin || true
|
||||
echo "✅ WeChat Mini Program dev mode test completed"
|
||||
|
||||
- name: Test H5 dev mode
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Testing H5 dev mode startup..."
|
||||
timeout 30s pnpm dev:h5 || true
|
||||
echo "✅ H5 dev mode test completed"
|
||||
|
||||
- name: Test iOS dev mode
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Testing iOS dev mode startup..."
|
||||
timeout 30s pnpm dev:app-ios || true
|
||||
echo "✅ iOS dev mode test completed"
|
||||
|
||||
- name: Build WeChat Mini Program
|
||||
run: pnpm build:mp-weixin
|
||||
|
||||
- name: Build H5
|
||||
run: pnpm build:h5
|
||||
|
||||
- name: Build iOS
|
||||
run: pnpm build:app-ios
|
||||
|
||||
- name: Upload WeChat Mini Program artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wechat-miniprogram-build
|
||||
path: dist/build/mp-weixin/
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload H5 artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: h5-build
|
||||
path: dist/build/h5/
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload iOS artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-build
|
||||
path: dist/build/app-ios/
|
||||
retention-days: 7
|
||||
|
||||
- name: Build summary
|
||||
run: |
|
||||
echo "## Build and Test Summary" >> $GITHUB_STEP_SUMMARY
|
||||
echo "### Development Mode Tests" >> $GITHUB_STEP_SUMMARY
|
||||
echo "✅ WeChat Mini Program dev mode test completed" >> $GITHUB_STEP_SUMMARY
|
||||
echo "✅ H5 dev mode test completed" >> $GITHUB_STEP_SUMMARY
|
||||
echo "✅ iOS dev mode test completed" >> $GITHUB_STEP_SUMMARY
|
||||
echo "### Build Results" >> $GITHUB_STEP_SUMMARY
|
||||
echo "✅ WeChat Mini Program build completed" >> $GITHUB_STEP_SUMMARY
|
||||
echo "✅ H5 build completed" >> $GITHUB_STEP_SUMMARY
|
||||
echo "✅ iOS build completed" >> $GITHUB_STEP_SUMMARY
|
||||
echo "📦 All artifacts uploaded successfully" >> $GITHUB_STEP_SUMMARY
|
||||
- name: Build Docs (VitePress)
|
||||
run: pnpm -C docs run docs:build
|
||||
|
||||
- name: Upload Docs artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: docs-build
|
||||
path: docs/.vitepress/dist/
|
||||
retention-days: 7
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.9.0
|
||||
run_install: false
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
generate_release_notes: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Generate GitHub Changelog
|
||||
run: pnpx changelogithub
|
||||
continue-on-error: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Release summary
|
||||
run: |
|
||||
echo "## Release Summary" >> $GITHUB_STEP_SUMMARY
|
||||
echo "### Version: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "### Release Status" >> $GITHUB_STEP_SUMMARY
|
||||
echo "✅ Release created successfully" >> $GITHUB_STEP_SUMMARY
|
||||
Reference in New Issue
Block a user