Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
push:
branches: [main]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -14,6 +17,8 @@ jobs:
python-version: ['3.11', '3.13']
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/setup-python@v7
with:
Expand Down
36 changes: 29 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,30 @@ permissions:
contents: read

jobs:
release:
test:
runs-on: ubuntu-latest
permissions:
contents: write
contents: read
env:
TAG: ${{ github.event.inputs.tag || github.ref_name }}
TAG: ${{ inputs.tag || github.ref_name }}
steps:
- name: Validate tag format
run: |
case "$TAG" in
""|*[!A-Za-z0-9._-]*|-*|*..*)
echo "::error::Invalid release tag: $TAG"
exit 1
;;
esac
if ! printf '%s\n' "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9.]+)?$'; then
echo "::error::Tag must match vX.Y.Z[-suffix]: $TAG"
exit 1
fi

- uses: actions/checkout@v7
with:
ref: ${{ github.event.inputs.tag || github.ref }}
ref: ${{ inputs.tag || github.ref }}
persist-credentials: false

# Image CI pins the dbuild release in daemonless/workflows (DBUILD_REF),
# bumped there by PR after this release.
Expand All @@ -44,6 +58,14 @@ jobs:
pip install -e '.[dev,screenshot]'
python -m pytest tests/ -q

publish:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
env:
TAG: ${{ inputs.tag || github.ref_name }}
steps:
# Create once; a re-run on a tag that already has one does nothing.
- name: Publish release
env:
Expand All @@ -55,10 +77,10 @@ jobs:
exit 0
fi
# A hyphen (v1.11.0-rc1) is a pre-release, never marked Latest.
PRE=""
case "${VERSION}" in *-*) PRE="--prerelease" ;; esac
set --
case "${VERSION}" in *-*) set -- --prerelease ;; esac
gh release create "${TAG}" \
--repo "${{ github.repository }}" \
--title "v${VERSION}" \
--generate-notes \
$PRE
"$@"
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Build, test, and push FreeBSD OCI container images.

dbuild is a build tool for [daemonless](https://github.com/daemonless) container images. It reads a project directory containing `Containerfile` templates and an optional `.daemonless/config.yaml`, then handles the full image lifecycle: build, integration test, SBOM generation, and registry push.

It runs the same way locally and in CI. GitHub Actions and Woodpecker call dbuild — dbuild handles the FreeBSD-specific logic (variant detection, architecture mapping, OCI labels, registry auth, skip directives, SBOM generation) so CI workflows stay generic.
It runs the same way locally and in CI. GitHub Actions calls dbuild — dbuild handles the FreeBSD-specific logic (variant detection, architecture mapping, OCI labels, registry auth, skip directives, SBOM generation) so CI workflows stay generic.

```
GitHub Actions / Woodpecker / local
GitHub Actions / local
└── dbuild detect → build matrix
└── dbuild build → podman build per variant
└── dbuild test → container integration tests
Expand Down Expand Up @@ -251,7 +251,6 @@ Output the build matrix as JSON for CI integration.
```sh
dbuild detect # plain JSON to stdout
dbuild detect --format github # write to $GITHUB_OUTPUT
dbuild detect --format woodpecker # JSON to stdout
```

### `dbuild info`
Expand Down Expand Up @@ -279,7 +278,6 @@ Scaffold a new dbuild project with starter files.
```sh
dbuild init # config.yaml, compose.yaml, Containerfile.j2, root/
dbuild init --github # + GitHub Actions workflow
dbuild init --woodpecker # + Woodpecker CI pipeline
```

The image is a single process on `base-exec`: `/init` runs the setup script
Expand Down Expand Up @@ -365,14 +363,6 @@ This generates `.github/workflows/build.yaml` which:
2. Spins up a FreeBSD VM per matrix entry (via vmactions/freebsd-vm)
3. Runs `dbuild build → test → sbom → push` inside the VM

### Woodpecker CI

```sh
dbuild init --woodpecker
```

Generates `.woodpecker.yaml`. The pipeline fetches `dbuild-ci.sh` which runs the full build pipeline on the native FreeBSD agent.

### Local development

```sh
Expand Down
31 changes: 0 additions & 31 deletions bootstrap.sh

This file was deleted.

47 changes: 0 additions & 47 deletions dbuild-ci.sh

This file was deleted.

4 changes: 0 additions & 4 deletions dbuild/ci/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ def detect() -> CIBase:
from dbuild.ci.github import GitHubCI
return GitHubCI()

if os.environ.get("CI_PIPELINE_ID"):
from dbuild.ci.woodpecker import WoodpeckerCI
return WoodpeckerCI()

if os.environ.get("GITLAB_CI"):
from dbuild.ci.gitlab import GitLabCI
return GitLabCI()
Expand Down
113 changes: 0 additions & 113 deletions dbuild/ci/woodpecker.py

This file was deleted.

14 changes: 3 additions & 11 deletions dbuild/ci_run.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""CI pipeline orchestration.

Replaces ``dbuild-ci.sh`` with a pure-Python implementation that calls
the build, test, push, and sbom modules directly. Runs the full
pipeline: build -> test -> push -> sbom.
Runs the full CI pipeline via Python calls to build, test, push, and sbom
(build -> test -> push -> sbom).

On PR builds, push and sbom are skipped. Commit-message directives
like ``[skip test]`` and ``[skip push]`` are honoured by the
Expand All @@ -13,7 +12,7 @@

import argparse

from dbuild import build, log, prepare, push, sbom, test
from dbuild import build, log, push, sbom, test
from dbuild import ci as ci_mod
from dbuild.config import Config

Expand All @@ -30,7 +29,6 @@ def run(cfg: Config, args: argparse.Namespace) -> int:

* ``variant`` -- build only this tag (optional).
* ``arch`` -- target architecture override (optional).
* ``prepare`` -- run ci-prepare first (optional).

Returns ``0`` on success, non-zero on failure.
"""
Expand All @@ -39,12 +37,6 @@ def run(cfg: Config, args: argparse.Namespace) -> int:
log.warn("Image is deprecated — skipping CI pipeline")
return 0

# Optional: run ci-prepare first
if getattr(args, "prepare", False):
rc = prepare.run(args)
if rc != 0:
return rc

# ── Build ────────────────────────────────────────────────────────
log.step("CI: Build")
rc = build.run(cfg, args)
Expand Down
Loading