ZDDC/.woodpecker.yml
ZDDC c2e8d364a9 chore(ci): drop :latest image tag — stable/beta/alpha is canonical
The renamed channel naming (latest → stable) only landed in the
filesystem layout and the bootstrap; the image-publish pipeline still
applied :latest as an alias for :stable on stable releases. Drop it
to avoid mixed terminology.

.woodpecker.yml: stable releases now apply only :X.Y.Z, :stable,
:beta, :alpha. zddc/README.md updated to show stable/beta/alpha
channel tags and explicitly note :latest is not published.

To clean up the existing :latest tag on the registry (one-time):

  curl -X DELETE \
    -H "Authorization: token $CODEBERG_TOKEN" \
    https://codeberg.org/api/v1/packages/varasys/container/zddc-server/latest

or via the web UI at codeberg.org/VARASYS/-/packages/container/zddc-server.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 10:07:52 -05:00

79 lines
2.9 KiB
YAML

# Woodpecker CI for ZDDC.
#
# Triggers on `zddc-server-v*` tag pushes. Builds the runtime container
# image and publishes it to Codeberg's container registry with channel
# tags that cascade downward, so that pinning to `:stable` always gets
# the most recent stable, `:beta` always tracks the most recent beta-or-
# stable, and `:alpha` always tracks the most recent alpha-or-newer.
#
# Tag conventions
# ---------------
# zddc-server-vX.Y.Z → stable release
# zddc-server-vX.Y.Z-beta.N → beta release
# zddc-server-vX.Y.Z-alpha.N → alpha release
#
# Image tags applied (cascading)
# ------------------------------
# stable release: :X.Y.Z + :stable, :beta, :alpha
# beta release: :X.Y.Z-beta.N + :beta, :alpha
# alpha release: :X.Y.Z-alpha.N + :alpha
#
# `:latest` is intentionally NOT published. The project uses
# `stable / beta / alpha` channel terminology consistently; see
# AGENTS.md "Channel discipline".
#
# To enable: in the Woodpecker dashboard at https://ci.codeberg.org →
# repo → Settings → Secrets, add codeberg_user (your Codeberg username)
# and codeberg_token (a personal token with package:write scope from
# https://codeberg.org/user/settings/applications). Restrict both
# secrets to the `tag` event for safety.
when:
- event: tag
ref: refs/tags/zddc-server-v*
steps:
prepare-bundle:
image: docker.io/alpine:3.20
commands:
# 1. Assemble zddc/dist/web/ from the landing + archive built outputs.
# build.sh now skips the (host-side) podman binary build when
# podman is absent, which is the case in CI — the runtime
# container image's own builder stage produces linux/amd64.
- sh build.sh
# 2. Compute the image tags. Grammar:
# zddc-server-vX.Y.Z → stable
# zddc-server-vX.Y.Z-alpha.N → alpha (cascade: alpha)
# zddc-server-vX.Y.Z-beta.N → beta (cascade: beta, alpha)
# Anything else is rejected by the `when:` filter; nothing to
# handle here.
- |
VERSION="${CI_COMMIT_TAG#zddc-server-v}"
case "$VERSION" in
*-alpha.*) CHANNEL=alpha ;;
*-beta.*) CHANNEL=beta ;;
*) CHANNEL=stable ;;
esac
case "$CHANNEL" in
stable) TAGS="$VERSION stable beta alpha" ;;
beta) TAGS="$VERSION beta alpha" ;;
alpha) TAGS="$VERSION alpha" ;;
esac
printf '%s\n' $TAGS > .image-tags
echo "Channel: $CHANNEL"
echo "Tags: $TAGS"
publish-image:
image: woodpeckerci/plugin-docker-buildx
settings:
registry: codeberg.org
repo: codeberg.org/varasys/zddc-server
dockerfile: zddc/Containerfile
context: zddc
target: server
tags_file: .image-tags
auto_tag: false
username:
from_secret: codeberg_user
password:
from_secret: codeberg_token