# 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, :latest # beta release: :X.Y.Z-beta.N + :beta, :alpha # alpha release: :X.Y.Z-alpha.N + :alpha # # `:latest` is kept as an alias for `:stable` (Docker convention). # # 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 latest" ;; 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