diff --git a/AGENTS.md b/AGENTS.md index b686ba4..22a8484 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -278,14 +278,20 @@ ZDDC_DATA_DIR=/path/to/your/archive podman-compose -f zddc/podman-compose.yaml u Two coordinated steps — git tag for auditability, then local image build: ```sh -git tag zddc-server-v1.0.0 -git push origin zddc-server-v1.0.0 -sh release-image.sh 1.0.0 # → :1.0.0 :stable :beta :alpha +git tag zddc-server-v0.0.4 +git push origin zddc-server-v0.0.4 +sh release-image.sh 0.0.4 # default: alpha → :0.0.4 :alpha +sh release-image.sh 0.0.4 beta # beta cascade → :0.0.4 :beta :alpha +sh release-image.sh 0.0.4 stable # stable cascade → :0.0.4 :stable :beta :alpha ``` -The cascade matches the channel rules elsewhere in the repo: stable bumps -all four tags; `beta` bumps `:1.0.0-beta.N :beta :alpha`; `alpha` bumps -`:1.0.0-alpha.N :alpha`. See `release-image.sh` for the full mapping. +**Default channel is `alpha`** so `:stable` never advances by accident +during active development. Pass `beta` to soak; pass `stable` only when +deliberately promoting. Cascades: + +- `alpha` → `: :alpha` +- `beta` → `: :beta :alpha` +- `stable` → `: :stable :beta :alpha` Prerequisite: `podman login codeberg.org` (one-time, with a Codeberg personal token scoped `package:write`). diff --git a/build.sh b/build.sh index 0161e4f..48a1ca8 100755 --- a/build.sh +++ b/build.sh @@ -27,17 +27,19 @@ cp "$SCRIPT_DIR/archive/dist/archive.html" "$SCRIPT_DIR/zddc/dist/web/archive.ht echo "Wrote zddc/dist/web/index.html" echo "Wrote zddc/dist/web/archive.html" -# Cross-compiled zddc-server binaries are built via podman if available -# (no-op otherwise — CI builds the runtime container directly via the -# Containerfile's builder stage and doesn't need host-side binaries). +# Cross-compiled zddc-server binaries — only relevant if you're shipping +# standalone Linux/macOS/Windows binaries to users. Skipped silently when +# podman isn't on PATH; the runtime container release path +# (release-image.sh) does its own internal build via Containerfile's +# multi-stage flow and doesn't need these host-side binaries. echo "" echo "=== Building zddc-server binaries ===" if command -v podman >/dev/null 2>&1; then podman build --target binaries -o "$SCRIPT_DIR/zddc/dist/" "$SCRIPT_DIR/zddc/" 2>&1 | grep -v "^-->" else echo "podman not found — skipping cross-compiled binary build." - echo " (CI builds the container image directly; this step only matters" - echo " for releasing the standalone Linux/macOS/Windows binaries.)" + echo " (Standalone-binary distribution only; the runtime container" + echo " release path builds its own copy via Containerfile.)" fi # ─── Bootstrap zips ────────────────────────────────────────────────────────── diff --git a/release-image.sh b/release-image.sh index f3b8423..49df0bd 100755 --- a/release-image.sh +++ b/release-image.sh @@ -3,19 +3,24 @@ # to codeberg.org/varasys/zddc-server with cascading channel tags. # # Usage: -# sh release-image.sh [stable|beta|alpha] +# sh release-image.sh [alpha|beta|stable] # -# stable → : :stable :beta :alpha (default) +# alpha → : :alpha (default — for active dev) # beta → : :beta :alpha -# alpha → : :alpha +# stable → : :stable :beta :alpha # # Examples: -# sh release-image.sh 0.0.3 # → :0.0.3 :stable :beta :alpha -# sh release-image.sh 0.0.3-beta.1 beta # → :0.0.3-beta.1 :beta :alpha -# sh release-image.sh 0.0.3-alpha.2 alpha # → :0.0.3-alpha.2 :alpha +# sh release-image.sh 0.0.4 # → :0.0.4 :alpha (default) +# sh release-image.sh 0.0.4 beta # → :0.0.4 :beta :alpha +# sh release-image.sh 0.0.4 stable # → :0.0.4 :stable :beta :alpha # -# Convention: cut a git tag first (`git tag zddc-server-v0.0.3 && git push -# origin zddc-server-v0.0.3`) so version history is auditable, then run this +# Why alpha is the default: `:stable` should only advance on a deliberate +# promotion, not as a side-effect of every dev release. With alpha as +# default, `sh release-image.sh ` always lands on the alpha +# channel; the `:stable` tag stays put until you explicitly pass `stable`. +# +# Convention: cut a git tag first (`git tag zddc-server-v0.0.4 && git push +# origin zddc-server-v0.0.4`) so version history is auditable, then run this # to publish the image. The two are coordinated by hand, deliberately — # `.woodpecker.yml` is gone; this script is the canonical path. # @@ -34,20 +39,21 @@ set -eu usage() { - echo "usage: $0 [stable|beta|alpha]" >&2 - echo " version: e.g. 0.0.3, 0.0.3-beta.1, 0.0.3-alpha.2" >&2 + echo "usage: $0 [alpha|beta|stable]" >&2 + echo " channel default: alpha (active dev)" >&2 + echo " version: e.g. 0.0.4, 0.0.4-beta.1, 0.0.4-alpha.2" >&2 exit 1 } [ $# -ge 1 ] || usage VERSION="$1" -CHANNEL="${2:-stable}" +CHANNEL="${2:-alpha}" case "$CHANNEL" in - stable) TAGS="$VERSION stable beta alpha" ;; - beta) TAGS="$VERSION beta alpha" ;; alpha) TAGS="$VERSION alpha" ;; - *) echo "error: unknown channel: $CHANNEL (expected stable|beta|alpha)" >&2; exit 1 ;; + beta) TAGS="$VERSION beta alpha" ;; + stable) TAGS="$VERSION stable beta alpha" ;; + *) echo "error: unknown channel: $CHANNEL (expected alpha|beta|stable)" >&2; exit 1 ;; esac REPO="codeberg.org/varasys/zddc-server" diff --git a/zddc/Containerfile b/zddc/Containerfile index 37b2b96..5c519f0 100644 --- a/zddc/Containerfile +++ b/zddc/Containerfile @@ -12,8 +12,9 @@ # # Build context expectations (when targeting `server`): # dist/web/index.html and dist/web/archive.html must exist — -# produced by `sh build.sh` from the repo root. CI assembles these -# before invoking podman. See .woodpecker.yml. +# produced by `sh build.sh` from the repo root. The release flow +# (`release-image.sh` at the repo root) runs build.sh first and +# then invokes `podman build --target server`. # # ─── Stage 1: build ────────────────────────────────────────────────────────── diff --git a/zddc/README.md b/zddc/README.md index b51977e..5687b7b 100644 --- a/zddc/README.md +++ b/zddc/README.md @@ -461,13 +461,14 @@ steps — git tag for auditability, then local image build and push: ```sh # 1. Tag the source. -git tag zddc-server-v1.0.0 -git push origin zddc-server-v1.0.0 +git tag zddc-server-v0.0.4 +git push origin zddc-server-v0.0.4 -# 2. Build and push the runtime image with cascading channel tags. -sh release-image.sh 1.0.0 # → :1.0.0 :stable :beta :alpha -sh release-image.sh 1.0.0-beta.1 beta # beta-channel release -sh release-image.sh 1.0.0-alpha.2 alpha # alpha-channel release +# 2. Build and push the runtime image. Default cascade is alpha-only, +# so `:stable` doesn't advance unless you deliberately promote. +sh release-image.sh 0.0.4 # → :0.0.4 :alpha (default) +sh release-image.sh 0.0.4 beta # → :0.0.4 :beta :alpha +sh release-image.sh 0.0.4 stable # → :0.0.4 :stable :beta :alpha ``` Prerequisite: `podman login codeberg.org` (or `docker login`) once,