ci: 添加 Woodpecker CI 配置并更新 .gitignore
Some checks failed
ci/woodpecker/tag/woodpecker Pipeline was canceled
Some checks failed
ci/woodpecker/tag/woodpecker Pipeline was canceled
- 新增 tag 触发的 amd64/arm64 多架构构建与发布流水线 - .gitignore 忽略 .qwen 目录 - 修复 .gitignore 文件末尾换行符 Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
/logs
|
||||
/.idea
|
||||
/.vscode
|
||||
/.qwen
|
||||
|
||||
*.mp3
|
||||
game-driver*
|
||||
game-driver*
|
||||
|
||||
34
.woodpecker.yml
Normal file
34
.woodpecker.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
when:
|
||||
- event: tag
|
||||
|
||||
clone:
|
||||
git:
|
||||
image: docker.m.daocloud.io/woodpeckerci/plugin-git
|
||||
settings:
|
||||
depth: 1
|
||||
|
||||
steps:
|
||||
# 构建多架构二进制文件
|
||||
build:
|
||||
image: docker.m.daocloud.io/golang:1.23-trixie
|
||||
commands:
|
||||
- apt-get update && apt-get install -y gcc-aarch64-linux-gnu gcc-x86-64-linux-gnu
|
||||
- mkdir -p release
|
||||
# 构建 amd64 (native)
|
||||
- GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=x86-64-linux-gnu-gcc go build -ldflags="-w -s" -o release/game-driver-linux-amd64 .
|
||||
# 构建 arm64 (cross-compile)
|
||||
- GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc go build -ldflags="-w -s" -o release/game-driver-linux-arm64 .
|
||||
|
||||
# 发布构建产物(可选)
|
||||
release:
|
||||
image: docker.m.daocloud.io/woodpeckerci/plugin-release
|
||||
settings:
|
||||
base-url: https://gitea.tides.top
|
||||
title: ${CI_COMMIT_TAG}
|
||||
api-key:
|
||||
from_secret: gitea_token
|
||||
files:
|
||||
- release/game-driver-linux-amd64
|
||||
- release/game-driver-linux-arm64
|
||||
depends_on:
|
||||
- build
|
||||
Reference in New Issue
Block a user