add some tips

This commit is contained in:
Awuqing
2026-03-17 13:45:31 +08:00
parent eadd3f8961
commit aff334e1af
9 changed files with 790 additions and 37 deletions

43
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,43 @@
---
name: "\U0001F41B Bug 报告"
about: "报告一个 Bug帮助我们改进 BackupX"
title: "[Bug] "
labels: ["bug"]
assignees: []
---
## 描述
<!-- 清晰简洁地描述这个 Bug -->
## 复现步骤
1.
2.
3.
## 期望行为
<!-- 描述你期望发生什么 -->
## 实际行为
<!-- 描述实际发生了什么 -->
## 环境信息
- **OS**: <!-- 例如 Ubuntu 22.04 -->
- **Go 版本**: <!-- 例如 1.21 -->
- **Node.js 版本**: <!-- 例如 18.17 -->
- **浏览器**: <!-- 例如 Chrome 120 -->
- **BackupX 版本**: <!-- 例如 v1.0.0 -->
## 相关日志
```
<!-- 粘贴相关日志输出 -->
```
## 截图
<!-- 如有截图请附上 -->

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 💬 讨论区 / Discussions
url: https://github.com/Awuqing/GoogleDriverBackupEveryDay/discussions
about: 提问、讨论功能想法或分享使用经验

View File

@@ -0,0 +1,23 @@
---
name: "\U0001F680 功能请求"
about: "建议一个新功能或改进"
title: "[Feature] "
labels: ["enhancement"]
assignees: []
---
## 需求描述
<!-- 清晰简洁地描述你希望的功能 -->
## 使用场景
<!-- 描述你在什么场景下需要这个功能 -->
## 建议的解决方案
<!-- 描述你认为应该如何实现(可选) -->
## 补充信息
<!-- 任何其他相关信息、截图或上下文 -->

29
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,29 @@
## Pull Request
### 变更类型 / Type of Change
- [ ] 🐛 Bug 修复 (非破坏性变更)
- [ ] ✨ 新功能 (非破坏性变更)
- [ ] 💥 破坏性变更 (修复或功能导致现有功能变更)
- [ ] 📝 文档更新
- [ ] ♻️ 代码重构 (不影响功能)
- [ ] ⚡ 性能优化
### 描述 / Description
<!-- 描述你做了什么更改以及为什么 -->
### 相关 Issue / Related Issue
<!-- 关联的 Issue 编号,如 Fixes #123 -->
### 测试 / Testing
- [ ] 后端测试通过 (`go test ./...`)
- [ ] 前端测试通过 (`npm run test`)
- [ ] 前端构建成功 (`npm run build`)
- [ ] 已在本地环境手动测试
### 截图 / Screenshots
<!-- 如有 UI 变更请附上截图 -->

34
.github/SECURITY.md vendored Normal file
View File

@@ -0,0 +1,34 @@
# 安全漏洞披露政策 / Security Policy
## 支持的版本 / Supported Versions
| Version | Supported |
|---------|--------------------|
| latest | ✅ |
| < latest | ❌ |
## 报告安全漏洞 / Reporting a Vulnerability
如果您发现了安全漏洞,**请不要通过公开 Issue 报告**。
请发送邮件至项目维护者,包含以下信息:
1. 漏洞描述
2. 复现步骤
3. 受影响的版本
4. 可能的影响范围
我们会在 48 小时内确认收到并开始处理。
---
If you discover a security vulnerability, **please do NOT open a public issue**.
Instead, email the project maintainer with the following details:
1. Description of the vulnerability
2. Steps to reproduce
3. Affected versions
4. Potential impact
We will acknowledge receipt within 48 hours and begin working on a fix.

57
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
backend:
name: Go Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache-dependency-path: server/go.sum
- name: Build
working-directory: server
run: go build ./...
- name: Test
working-directory: server
run: go test ./... -v
frontend:
name: React Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install dependencies
working-directory: web
run: npm ci
- name: Type Check
working-directory: web
run: npx tsc --noEmit -p tsconfig.json
- name: Test
working-directory: web
run: npm run test
- name: Build
working-directory: web
run: npm run build

63
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Build & Release
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache-dependency-path: server/go.sum
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Build frontend
working-directory: web
run: |
npm ci
npm run build
- name: Build backend
working-directory: server
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 1
run: |
go build -ldflags "-s -w -X main.version=${{ github.ref_name }}" -o ../backupx-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/backupx
- name: Package release
run: |
mkdir -p release
cp backupx-${{ matrix.goos }}-${{ matrix.goarch }} release/
cp -r web/dist release/web
cp server/config.example.yaml release/
cp deploy/install.sh release/ 2>/dev/null || true
cd release && tar czf ../backupx-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz .
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: backupx-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
generate_release_notes: true