ci: allow manual semver image publishing
This commit is contained in:
1 parent
65ae850c0c
commit
9964b4e3ad
2 files changed
+8
-3
No files matched your search
@@ -1,6 +1,7 @@
|
||||
when:
|
||||
- event: tag
|
||||
ref: refs/tags/v*
|
||||
- event: manual
|
||||
|
||||
labels:
|
||||
ci: domain-linux-native
|
||||
@@ -18,7 +19,9 @@ steps:
|
||||
release-checks:
|
||||
image: bash
|
||||
commands:
|
||||
- node scripts/check-api-contract.mjs "$CI_COMMIT_TAG"
|
||||
- release_tag="${CI_COMMIT_TAG:-${RELEASE_TAG:-}}"
|
||||
- test -n "$release_tag"
|
||||
- node scripts/check-api-contract.mjs "$release_tag"
|
||||
- dotnet test server/WebDrop.slnx --configuration Release --verbosity minimal
|
||||
|
||||
publish-backend:
|
||||
@@ -31,8 +34,10 @@ steps:
|
||||
ZOT_REGISTRY: zot.oeo.one
|
||||
commands:
|
||||
- set -euo pipefail
|
||||
- release_tag="${CI_COMMIT_TAG:-${RELEASE_TAG:-}}"
|
||||
- test -n "$release_tag"
|
||||
- printf '%s' "$ZOT_PASSWORD" | buildah login "$ZOT_REGISTRY" --username "$ZOT_USERNAME" --password-stdin
|
||||
- trap 'buildah logout "$ZOT_REGISTRY" >/dev/null 2>&1 || true' EXIT
|
||||
- image="$ZOT_REGISTRY/justme/webdrop-api:$CI_COMMIT_TAG"
|
||||
- image="$ZOT_REGISTRY/justme/webdrop-api:$release_tag"
|
||||
- buildah bud --format docker --platform linux/amd64 --tag "$image" --file server/Dockerfile .
|
||||
- buildah push "$image" "docker://$image"
|
||||
+1
-1
@@ -34,7 +34,7 @@ CAPTCHA_SECRET=<server-side-secret>
|
||||
|
||||
## Woodpecker CI
|
||||
|
||||
`.woodpecker/ci.yml` 在 push 和手动运行时执行 API 契约、Core、Web、服务端检查;每次 push 都会构建前端。`.woodpecker/release-backend.yml` 仅响应 `vMAJOR.MINOR.PATCH` SemVer tag;测试通过后用 Linux native agent 的 Buildah 构建并推送同名后端镜像 tag。两者都通过 Woodpecker secret `gitea_clone_webdrop` 从 `https://git.oeo.one` 克隆私有仓库。
|
||||
`.woodpecker/ci.yml` 在 push 和手动运行时执行 API 契约、Core、Web、服务端检查;每次 push 都会构建前端。`.woodpecker/release-backend.yml` 响应 `vMAJOR.MINOR.PATCH` SemVer tag;也可手动运行并传入 `RELEASE_TAG`(例如 `v0.1.0`)。测试通过后用 Linux native agent 的 Buildah 构建并推送同名后端镜像 tag。两者都通过 Woodpecker secret `gitea_clone_webdrop` 从 `https://git.oeo.one` 克隆公开仓库。
|
||||
|
||||
两条流水线固定到 `ci: domain-linux-native` 的 `linux/amd64` Agent;该主机需要 Node 24、.NET 10 和 Buildah。Gitea webhook 走同 Docker 网络中的 `woodpecker-server:8000`,代码 clone 走公网 Git 域名。
|
||||
|
||||
|
||||
Reference in new issue
Block a user