diff --git a/.gitea/workflows/docker-publish.yml b/.gitea/workflows/docker-publish.yml index d75243f..96efa72 100644 --- a/.gitea/workflows/docker-publish.yml +++ b/.gitea/workflows/docker-publish.yml @@ -199,16 +199,39 @@ jobs: require_sha MEMPALACE_TOOLKIT_REF "$MEMPALACE_TOOLKIT_REF" echo "mempalace_toolkit_ref=${MEMPALACE_TOOLKIT_REF}" >> "$GITHUB_OUTPUT" - # pi-studio (omaclaren/pi-studio) → commit SHA for :latest-studio. - STUDIO_REF=$(curl -sf -H "Accept: application/vnd.github.sha" \ - "https://api.github.com/repos/omaclaren/pi-studio/commits/main" || true) + # pi-studio (omaclaren/pi-studio) → newest SEMVER TAG's commit SHA + # for the :*-studio images. Upstream stopped publishing GitHub + # *Releases* at v0.5.55 but keeps tagging every version (vX.Y.Z) and + # pushing to main, so pinning main HEAD risked baking half-finished + # commits that land after a tag. Take the newest stable tag instead. + # List ALL tags in one `git ls-remote` call — the REST tags API + # paginates at 100 and this repo already has >140 tags, so page 1 is + # NOT guaranteed to hold the newest — pick the highest X.Y.Z with + # `sort -V` (pre-releases like -rc1 excluded by the strict filter), + # then resolve its commit SHA (a SHA, not a moving tag, preserves + # cache-busting + reproducibility and is what require_sha demands). + STUDIO_TAGS=$(git ls-remote --tags "https://github.com/omaclaren/pi-studio.git" || true) + STUDIO_TAG=$(printf '%s\n' "$STUDIO_TAGS" | awk '{print $2}' \ + | sed -n 's#^refs/tags/##p' \ + | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' \ + | sort -V | tail -n1 || true) + if [ -z "${STUDIO_TAG:-}" ]; then + echo "::error::Could not resolve a pi-studio semver tag (git ls-remote empty/unreachable). Refusing to fall back to a floating ref." + exit 1 + fi + # Prefer the peeled ^{} line (annotated tags); fall back to the + # direct ref (lightweight tags, which pi-studio currently uses). + STUDIO_REF=$(printf '%s\n' "$STUDIO_TAGS" | awk -v t="refs/tags/${STUDIO_TAG}^{}" '$2==t{print $1}') + if [ -z "$STUDIO_REF" ]; then + STUDIO_REF=$(printf '%s\n' "$STUDIO_TAGS" | awk -v t="refs/tags/${STUDIO_TAG}" '$2==t{print $1}') + fi require_sha PI_STUDIO_REF "$STUDIO_REF" echo "studio_ref=${STUDIO_REF}" >> "$GITHUB_OUTPUT" echo "Resolved PI_VERSION=${PI_VERSION}" echo "Resolved PI_FORK_REF=${FORK_REF}, PI_OBSMEM_REF=${OBSMEM_REF}" echo "Resolved PI_TOOLKIT_REF=${TOOLKIT_REF}, PI_EXTENSIONS_REF=${EXTENSIONS_REF}" - echo "Resolved PI_STUDIO_REF=${STUDIO_REF}" + echo "Resolved PI_STUDIO_REF=${STUDIO_REF} (pi-studio ${STUDIO_TAG})" echo "Resolved MEMPALACE_TOOLKIT_REF=${MEMPALACE_TOOLKIT_REF}" # ── Phase 2: build & push base (multi-arch), only when needed ────── diff --git a/CHANGELOG.md b/CHANGELOG.md index b4b5917..737e2de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,22 @@ Pre-v1.0.0 tags followed the pi npm version (`v{pi_version}[letter]`). overridden per-user (`:set notermguicolors`, or your own init). Base-affecting (`Dockerfile.base` apt package + COPY), rebuilds `base-`. +### Changed + +- **`-studio` images now pin pi-studio to its newest *semver tag* instead of + `main` HEAD.** Upstream `omaclaren/pi-studio` abandoned GitHub *Releases* at + v0.5.55 but keeps tagging every version (currently `v0.9.36`) and pushing to + `main`; tracking `main` HEAD risked baking half-finished commits that land + after a tag. CI (`resolve-versions`) now lists every tag via a single + `git ls-remote` (the REST tags API paginates at 100 and the repo already has + >140 tags), selects the highest `X.Y.Z` with `sort -V` (pre-releases + excluded by a strict filter), and pins that tag's commit SHA into + `PI_STUDIO_REF`. Pinning the SHA (not the moving tag) preserves cache-busting + and reproducibility, is what `require_sha` demands, and is recorded in the + `se.jordbo.pi-devbox.pi-studio-ref` image label. Studio-variant only — not + base-affecting; takes effect on the next `-studio` build. No change to the + resolved commit today (`v0.9.36` == current `main` HEAD). + ### Fixed - **`pandoc --pdf-engine=typst` now works without `-V mainfont`.** pandoc's