From 8ff41c962e1c83e320da148ab42aa62ad2917d0d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Feb 2026 02:27:29 +0000 Subject: [PATCH] ci: add build check workflow and restrict release to tags only - Add ci-build.yml for frontend/backend/agent compilation checks on push/PR - Modify docker-build.yml to trigger only on version tags (not branches) --- .github/workflows/ci-build.yml | 70 ++++++++++++++++++++++++++++++ .github/workflows/docker-build.yml | 3 -- 2 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci-build.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..6d0d7cc --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,70 @@ +name: CI Build Check + +on: + push: + branches: ['**'] + pull_request: + branches: ['**'] + +jobs: + frontend: + name: Build Frontend + runs-on: ubuntu-latest + defaults: + run: + working-directory: vite-frontend + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: vite-frontend/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + backend: + name: Build Backend + runs-on: ubuntu-latest + defaults: + run: + working-directory: springboot-backend + steps: + - uses: actions/checkout@v4 + + - name: Setup Java 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + cache: 'maven' + + - name: Build with Maven + run: mvn clean package -DskipTests + + agent: + name: Build Agent + runs-on: ubuntu-latest + defaults: + run: + working-directory: go-gost + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.23' + cache-dependency-path: go-gost/go.sum + + - name: Download dependencies + run: go mod download + + - name: Build + run: go build -v . diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index b1c877c..34a6481 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -6,9 +6,6 @@ env: on: push: - branches: - - main - - beta tags: - '[0-9]*' # 匹配 2.0.8, 2.0.8-beta 等格式