Skip to content

refactor: 替换eslint规则,使用antfu/eslint模块 #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 29, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

169 changes: 0 additions & 169 deletions .eslintrc.js

This file was deleted.

112 changes: 56 additions & 56 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## CD交付流水线
## - 部署到Github Pages
## - 部署到Vercel托管平台
## - 发布新的Github Release
## 参考资料:https://v2.vuepress.vuejs.org/zh/guide/deployment.html#github-pages
# CD交付流水线
# - 部署到Github Pages
# - 部署到Vercel托管平台
# - 发布新的Github Release
# 参考资料:https://v2.vuepress.vuejs.org/zh/guide/deployment.html#github-pages

name: CD
on:
Expand All @@ -13,14 +13,14 @@ on:

# 环境变量
env:
## vercel
# vercel
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

jobs:
## 部署到Github-Pages
# 部署到Github-Pages
deploy-github:
name: "部署到Github-Pages"
name: 部署到Github-Pages
if: github.repository == '142vip/JavaScriptCollection'
runs-on: ubuntu-latest

Expand All @@ -32,21 +32,21 @@ jobs:
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0

## 安装PNPM
# 安装PNPM
- name: PNPM Install
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: 8
version: 9.6.0

## 安装Node环境
# 安装Node环境
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.18.0
## 淘宝镜像加速
node-version: 20.16.0
# 淘宝镜像加速
registry-url: 'https://registry.npmmirror.com'
## 缓存
cache: 'pnpm'
# 缓存
cache: pnpm

- name: Install Dependencies
run: |
Expand All @@ -67,15 +67,15 @@ jobs:
with:
pages_threshold: major_outage

## 获取Git提交信息
# 获取Git提交信息
- name: Get Commit Info
id: gitInfo
run: |
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
echo "author=$(git log -1 --pretty=%an)" >> $GITHUB_OUTPUT
echo "email=$(git log -1 --pretty=%ae)" >> $GITHUB_OUTPUT

## 参考:https://github.com/marketplace/actions/github-pages
# 参考:https://github.com/marketplace/actions/github-pages
- name: Deploy To GitHub Page
uses: crazy-max/ghaction-github-pages@v3
with:
Expand All @@ -90,40 +90,40 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

## 部署到vercel平台
# deploy-vercel:
# name: "部署到Vercel平台"
# needs: install-init
# runs-on: ubuntu-latest
# if: github.repository == '142vip/JavaScriptCollection'
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
#
# - name: Restore Dependencies From Cache
# uses: actions/cache@v3
# with:
# path: |
# node_modules
# key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
#
# - name: Pull Vercel Environment Information
# run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
#
# ## 注意:安装pnpm
# - name: Build Project Artifacts
# run: npm i pnpm@7 -g && vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
#
# - name: Deploy Project Artifacts to Vercel
# run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

## 版本发布
# 部署到vercel平台
# deploy-vercel:
# name: "部署到Vercel平台"
# needs: install-init
# runs-on: ubuntu-latest
# if: github.repository == '142vip/JavaScriptCollection'
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
#
# - name: Restore Dependencies From Cache
# uses: actions/cache@v3
# with:
# path: |
# node_modules
# key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
#
# - name: Pull Vercel Environment Information
# run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
#
# ## 注意:安装pnpm
# - name: Build Project Artifacts
# run: npm i pnpm@7 -g && vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
#
# - name: Deploy Project Artifacts to Vercel
# run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

# 版本发布
release:
name: "创建Github发布"
name: 创建Github发布
runs-on: ubuntu-latest
## 主库next且执行release更新时执行
# 主库next且执行release更新时执行
if: github.repository == '142vip/JavaScriptCollection' && startsWith(github.event.head_commit.message, 'chore(release):')

steps:
Expand All @@ -134,12 +134,12 @@ jobs:
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0

### 打成压缩包
# ## 打成压缩包
- name: Create Zip Package
run: |
zip -r JavaScriptCollection.zip . \
-x "node_modules/*" \
-x "*.git*"
-x "*.git*"

# 提取版本号
- name: Get New Version Number
Expand All @@ -158,12 +158,12 @@ jobs:
release_name: v${{ steps.releaseVersion.outputs.version }}
body: |
Release ${{ steps.releaseVersion.outputs.version }}

### Features

### Bug Fixes

## 更新资源
# 更新资源
- name: Upload Resource Assets
uses: actions/upload-release-asset@latest
env:
Expand Down Expand Up @@ -205,4 +205,4 @@ jobs:
# echo "-----------正在运行的服务--------"
# docker ps
# cd /service_env/ && git reset --hard && git pull origin main
# bash ./scripts/book_doc.deploy.sh jsc ${{steps.version.outputs.value}}
# bash ./scripts/book_doc.deploy.sh jsc ${{steps.version.outputs.value}}
Loading