
woodpecker-gitea-publisher-golang是Woodpecker CI的插件,用于将Golang包发布到Gitea的Go包注册表([***] zip文件、干运行模式、单体仓库支持及发布信息输出等功能,适用于需要通过Woodpecker CI自动化发布Golang包到Gitea的场景。
CI_FORGE_URL自动获取Gitea基础URLsettings.gitea-publish-golang-path-go逐个发布目录中的go.mod文件dist/go-mod-upload.json
settings.gitea-publish-golang-update-result-root-path修改输出根路径,默认值为distsettings.gitea-publish-golang-update-result-file-name修改输出文件名,默认值为go-mod-upload.json| 名称 | 必填 | 默认值 | 描述 |
|---|---|---|---|
debug | 否 | false | 开启调试日志,也可通过环境变量PLUGIN_DEBUG开启 |
gitea-publish-golang-api-key | 是 | Gitea API密钥,必填项 | |
gitea-publish-golang-base-url | 否 | Gitea基础URL,默认通过CI_FORGE_URL获取 | |
gitea-publish-golang-insecure | 否 | false | 允许不安全连接(如自签名证书) |
gitea-publish-golang-dry-run | 否 | false | 干运行模式(仅检查不实际发布) |
gitea-publish-golang-path-go | 否 | 要发布的Go包目录(相对于项目根路径),用于查找go.mod文件,默认项目根路径 | |
gitea-publish-golang-remove-paths | 否 | ["dist"] | 发布时需要移除的路径(相对于gitea-publish-golang-path-go),默认移除dist目录 |
gitea-publish-golang-update-result-root-path | 否 | dist | 发布信息输出根路径(相对于CI工作目录),默认dist |
gitea-publish-golang-update-result-file-name | 否 | go-mod-upload.json | 发布信息输出文件名,默认go-mod-upload.json |
| 名称 | 必填 | 默认值 | 描述 |
|---|---|---|---|
timeout_second | 否 | 10 | 命令超时时间(秒) |
gitea-publish-golang-timeout-second | 否 | 60 | Gitea发布API超时时间(秒),默认60,最小值30 |
woodpecker-kit-steps-transfer-file-path | 否 | .woodpecker_kit.steps.transfer | 步骤传输文件路径,默认wd_steps_transfer.DefaultKitStepsFileName |
woodpecker-kit-steps-transfer-disable-out | 否 | false | 禁用步骤传输文件输出 |
ymllabels: backend: docker steps: woodpecker-gitea-publisher-golang: image: sinlov/woodpecker-gitea-publisher-golang:latest pull: false settings: # debug: true # 开启调试日志 # gitea-publish-golang-dry-run: true # 干运行模式(仅检查不发布) gitea-publish-golang-api-key: # Gitea API密钥(必填) from_secret: gitea_api_key_release gitea-publish-golang-path-go: "" # 发布目录(默认项目根路径) gitea-publish-golang-remove-paths: # 需要移除的路径(默认包含dist) - "dist" # gitea-publish-golang-update-result-root-path: "dist" # 输出根路径(默认dist) # gitea-publish-golang-update-result-file-name: "go-mod-upload.json" # 输出文件名(默认值)
安装插件
${GOPATH}/bin:
bashgo install -a github.com/woodpecker-kit/woodpecker-gitea-publisher-golang/cmd/woodpecker-gitea-publisher-golang@latest
bashgo install -v github.com/woodpecker-kit/woodpecker-gitea-publisher-golang/cmd/woodpecker-gitea-publisher-golang@v1.0.0
工作流配置
ymllabels: backend: local steps: woodpecker-gitea-publisher-golang: image: woodpecker-gitea-publisher-golang settings: # debug: true # 开启调试日志 # gitea-publish-golang-dry-run: true # 干运行模式 gitea-publish-golang-api-key: # Gitea API密钥(必填) from_secret: gitea_api_key_release gitea-publish-golang-path-go: "" # 发布目录(默认项目根路径) gitea-publish-golang-remove-paths: - "dist"
yamllabels: backend: docker steps: woodpecker-gitea-publisher-golang: image: sinlov/woodpecker-gitea-publisher-golang:latest pull: false settings: debug: true # 开启调试日志 gitea-publish-golang-dry-run: true # 干运行模式 gitea-publish-golang-timeout-second: 120 # API超时时间(秒) gitea-publish-golang-api-key: # Gitea API密钥(必填) from_secret: gitea_api_key_release gitea-publish-golang-base-url: "https://gitea.example.com" # 自定义Gitea基础URL(默认从CI_FORGE_URL获取) gitea-publish-golang-insecure: true # 允许不安全连接 gitea-publish-golang-path-go: "sub-go" # 发布子目录(如单体仓库中的sub-go目录) gitea-publish-golang-remove-paths: - "dist" gitea-publish-golang-update-result-root-path: "dist" # 输出根路径 gitea-publish-golang-update-result-file-name: "go-mod-upload.json" # 输出文件名
tempDir/woodpecker-gitea-publisher-golang/{repo-hostname}/{owner}/{repo}/{build_number}zip.CreateFromDir生成,该方法会检查版本是否符合语义化版本规范,因此插件使用CI_COMMIT_TAG生成版本号。gitea-publish-golang-dry-run模式可通过所有检查,但不会实际发布到Gitea。CI_COMMIT_TAG),版本会标记为latest,此版本不符合zip.CreateFromDir检查,因此不会发布到Gitea。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务