From 80e644483a0385e9d20263b1248f25e41b8e2f12 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Tue, 14 Jul 2026 16:11:27 +0800 Subject: [PATCH] Add Gitea Actions CI/release workflow The ci job triggers on every push to main and every pull request; the release job triggers only on tag pushes matching v* and needs the ci job to pass first. We place the workflow under .github/workflows/ because Gitea Actions is API-compatible with GitHub Actions and discovers workflows in that directory. The release build command is GOOS=linux GOARCH=amd64 go build -o spark-mcp-linux-amd64 ./main.go, producing the Linux amd64 artifact requested for deployment. CI runs go build ./..., go vet ./..., go test ./..., and fails if gofmt -l . reports any unformatted files. Co-Authored-By: Claude --- .github/workflows/build.yml | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b3f68f0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,66 @@ +# This workflow runs on Gitea Actions, which is API-compatible with GitHub Actions. +# It performs CI on every push to main and every pull request, and automatically +# builds and attaches a Linux amd64 release binary when a version tag (v*) is pushed. +name: CI / Release + +on: + push: + branches: + - main + tags: + - 'v*' + pull_request: + +jobs: + ci: + name: CI + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Build + run: go build ./... + + - name: Vet + run: go vet ./... + + - name: Test + run: go test ./... + + - name: Check formatting + run: | + if [ -n "$(gofmt -l .)" ]; then + gofmt -l . + exit 1 + fi + + release: + name: Release + needs: ci + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Build release binary + run: GOOS=linux GOARCH=amd64 go build -o spark-mcp-linux-amd64 ./main.go + + - name: Upload release asset + uses: softprops/action-gh-release@v2 + with: + files: spark-mcp-linux-amd64 + generate_release_notes: true