mirror of
https://github.com/Awuqing/BackupX.git
synced 2026-05-06 20:02:41 +08:00
- Fix Go/Node version mismatch in CI (1.21→1.25, 18→20) - Rewrite release.yml: 3-job pipeline (frontend → binary release + Docker push) - Supports both tag push and manual workflow_dispatch trigger - Builds linux/amd64 + linux/arm64 binaries → GitHub Release tar.gz - Builds multi-arch Docker image → Docker Hub (awuqing/backupx) - Dockerfile: add ARG USE_CHINA_MIRROR for China network acceleration (npm→npmmirror, go→goproxy.cn, apk→aliyun), add ARG VERSION injection - Makefile: auto version from git tag, add docker/docker-cn targets - README: add beginner-friendly China build guide and release instructions
58 lines
1.1 KiB
YAML
58 lines
1.1 KiB
YAML
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.25'
|
|
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: '20'
|
|
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
|