Eliminate double towncrier run in release workflow #199
4 changed files with 6 additions and 33 deletions
Drop build_changelog, simplify build_docs to Quartz-only
build_changelog is no longer needed — towncrier now runs on the runner before Dagger. build_docs becomes the direct Quartz build (no towncrier delegation). Update docs to match. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
commit
5af97e6a7e
|
|
@ -23,35 +23,9 @@ class BlumeopsCi:
|
|||
ref = f"{registry}/blumeops/{container_name}:{version}"
|
||||
return await ctr.publish(ref)
|
||||
|
||||
@function
|
||||
async def build_changelog(
|
||||
self, src: dagger.Directory, version: str
|
||||
) -> dagger.Directory:
|
||||
"""Run towncrier to build changelog, return modified source tree."""
|
||||
return await (
|
||||
dag.container()
|
||||
.from_("python:3.12-slim")
|
||||
.with_env_variable("TZ", "America/Los_Angeles")
|
||||
# git is required because towncrier stages CHANGELOG.md via git add
|
||||
.with_exec(["apt-get", "update", "-qq"])
|
||||
.with_exec(["apt-get", "install", "-y", "-qq", "git"])
|
||||
.with_exec(["pip", "install", "towncrier"])
|
||||
.with_directory("/workspace", src)
|
||||
.with_workdir("/workspace")
|
||||
.with_exec(["git", "init"])
|
||||
.with_exec(["towncrier", "build", "--version", version, "--yes"])
|
||||
.directory("/workspace")
|
||||
)
|
||||
|
||||
@function
|
||||
async def build_docs(self, src: dagger.Directory, version: str) -> dagger.File:
|
||||
"""Build changelog then Quartz site. Returns docs tarball."""
|
||||
updated_src = await self.build_changelog(src, version)
|
||||
return await self.build_quartz(updated_src, version)
|
||||
|
||||
@function
|
||||
async def build_quartz(self, src: dagger.Directory, version: str) -> dagger.File:
|
||||
"""Build Quartz docs site from pre-processed source. Returns docs tarball."""
|
||||
"""Build Quartz docs site. Returns docs tarball."""
|
||||
return await (
|
||||
dag.container()
|
||||
.from_("node:22-slim")
|
||||
|
|
|
|||
|
|
@ -147,9 +147,9 @@ jobs:
|
|||
TARBALL="docs-${VERSION}.tar.gz"
|
||||
echo "Building docs via Dagger..."
|
||||
# Towncrier already ran on the runner above, so the working tree
|
||||
# has an up-to-date CHANGELOG.md. build-quartz skips towncrier
|
||||
# and only runs the Quartz static site build.
|
||||
dagger call build-quartz --src=. --version="$VERSION" \
|
||||
# has an up-to-date CHANGELOG.md. build-docs now only runs the
|
||||
# Quartz static site build (no towncrier).
|
||||
dagger call build-docs --src=. --version="$VERSION" \
|
||||
export --path="./$TARBALL"
|
||||
echo "Build complete!"
|
||||
ls -lh "$TARBALL"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ Direct link: https://forge.ops.eblu.me/eblume/blumeops/actions?workflow=build-bl
|
|||
The `build-blumeops` workflow (`.forgejo/workflows/build-blumeops.yaml`):
|
||||
|
||||
1. **Resolves version** — Uses input or auto-increments from latest release
|
||||
2. **Builds changelog** — Calls `dagger call build-changelog` (towncrier in a container)
|
||||
2. **Builds changelog** — Runs towncrier on the runner to update `CHANGELOG.md`
|
||||
3. **Builds docs** — Calls `dagger call build-docs` (Quartz build in a container)
|
||||
4. **Creates release** — Uploads `docs-<version>.tar.gz` to Forgejo releases
|
||||
5. **Updates deployment** — Edits `argocd/manifests/docs/deployment.yaml` with new URL
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@ Build engine for BlumeOps CI/CD pipelines. Replaces shell-based build scripts wi
|
|||
|----------|-----------|-------------|
|
||||
| `build` | `(src, container_name) → Container` | Build a container from `containers/<name>/Dockerfile` |
|
||||
| `publish` | `(src, container_name, version, registry?) → str` | Build and push to registry (default: `registry.ops.eblu.me`) |
|
||||
| `build_changelog` | `(src, version) → Directory` | Run towncrier to collect changelog fragments |
|
||||
| `build_docs` | `(src, version) → File` | Build changelog then Quartz site, return docs tarball |
|
||||
| `build_docs` | `(src, version) → File` | Build Quartz docs site, return docs tarball |
|
||||
|
||||
## CLI Examples
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue