10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
@@ -4,10 +4,12 @@
|
|||||||
|
|
||||||
## PR检查表
|
## PR检查表
|
||||||
|
|
||||||
- 该项目主要的工作分支有`main`和`dev`
|
- 该项目主要的工作分支有`main`、`release`和`dev`三个分支。
|
||||||
- 如要贡献代码,请从`dev`分支拉取代码,避免代码冲突,该分支一般包含最新待上线的功能。
|
- `main`分支用于生产环境,如果是修改文档、注释、代码格式化等不影响主要功能的修改,可以直接发起PR到`main`分支。
|
||||||
- 你的代码提交(添加新功能、修复bug、优化性能等)尽量发起PR到`dev`分支
|
- `release`分支用于发布新版本,为当前网站上运行的正式版本的代码。
|
||||||
- 请尽可能地在您的PR请求中描述清楚添加的功能或者修复的问题
|
- 如要贡献代码,请从`release`或者`main`分支拉取代码。
|
||||||
|
- 你的代码提交(添加新功能、修复bug、优化性能等)尽量发起PR到`dev`分支。
|
||||||
|
- 请尽可能地在您的PR请求中描述清楚添加的功能或者修复的问题。
|
||||||
- 在一个PR中有多个小提交是没问题的,但请确保每个提交都包含一个清晰的提交信息。
|
- 在一个PR中有多个小提交是没问题的,但请确保每个提交都包含一个清晰的提交信息。
|
||||||
- 请确保您的提交信息遵循[Conventional Commits](https://www.conventionalcommits.org/)规范。
|
- 请确保您的提交信息遵循[Conventional Commits](https://www.conventionalcommits.org/)规范。
|
||||||
|
|
||||||
|
|||||||
43
.github/workflows/node.js.yml
vendored
43
.github/workflows/node.js.yml
vendored
@@ -1,43 +0,0 @@
|
|||||||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
||||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
|
|
||||||
|
|
||||||
name: Node.js CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [22.x]
|
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: pnpm/action-setup@v2
|
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
cache: pnpm
|
|
||||||
- run: pnpm install
|
|
||||||
- run: pnpm build
|
|
||||||
- name: Copy and Rename index.html to dist
|
|
||||||
run: cp dist/index.html dist/404.html
|
|
||||||
|
|
||||||
- name: Deploy to gh-pages
|
|
||||||
uses: crazy-max/ghaction-github-pages@v2
|
|
||||||
with:
|
|
||||||
target_branch: gh-pages
|
|
||||||
build_dir: dist
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
|
||||||
43
.github/workflows/release.yml
vendored
43
.github/workflows/release.yml
vendored
@@ -52,6 +52,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: web-build
|
name: web-build
|
||||||
path: dist.zip
|
path: dist.zip
|
||||||
|
|
||||||
|
- name: Prepare GitHub Pages artifact
|
||||||
|
run: |
|
||||||
|
cp -r dist-prod dist-gh-pages
|
||||||
|
|
||||||
|
- name: Upload GitHub Pages artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: github-pages
|
||||||
|
path: dist-gh-pages
|
||||||
|
|
||||||
publish-tauri:
|
publish-tauri:
|
||||||
permissions:
|
permissions:
|
||||||
@@ -99,8 +109,37 @@ jobs:
|
|||||||
prerelease: false
|
prerelease: false
|
||||||
run: pnpm tauri build
|
run: pnpm tauri build
|
||||||
|
|
||||||
|
deploy-gh-pages:
|
||||||
|
needs: build-web
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download GitHub Pages artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: github-pages
|
||||||
|
path: dist-gh-pages
|
||||||
|
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v3
|
||||||
|
|
||||||
|
- name: Upload to GitHub Pages
|
||||||
|
uses: actions/deploy-pages@v2
|
||||||
|
id: deployment
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: ./dist-gh-pages
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build-web, publish-tauri]
|
needs: [build-web, publish-tauri, deploy-gh-pages]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -119,4 +158,4 @@ jobs:
|
|||||||
name: 'Release ${{ github.ref_name }}'
|
name: 'Release ${{ github.ref_name }}'
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: false
|
prerelease: false
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
Reference in New Issue
Block a user