diff --git a/.gitea/workflows/debian.yml b/.gitea/workflows/debian.yml index 3104b2b..1324513 100644 --- a/.gitea/workflows/debian.yml +++ b/.gitea/workflows/debian.yml @@ -22,9 +22,7 @@ jobs: set -euo pipefail for script in packaging/*.sh packaging/overlays/v1/*.sh; do bash -n "$script"; done mkdir -p "$RUNNER_TEMP/debs" - bash packaging/run.sh "$RUNNER_TEMP/debs" - docker run --rm --mount "type=bind,src=$PWD/packaging,dst=/checks/packaging,readonly" \ - -w /checks g15-packaging shellcheck packaging/*.sh packaging/overlays/v1/*.sh + bash packaging/ci.sh "$RUNNER_TEMP/debs" test -z "$(git submodule foreach --quiet --recursive 'git status --porcelain')" - name: Upload verified binaries and standalone sources uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3 (Gitea artifact protocol) diff --git a/README.md b/README.md index 4fd92af..def4a32 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,9 @@ Use the verified Debian source artifacts instead. Gitea Actions builds all five projects on pushes to `main` and manual dispatch. Successful runs provide the `debian13-amd64` artifact, including binaries, -standalone sources and `SHA256SUMS`. An `ubuntu-latest` runner with local Docker -and matching workspace mount paths is required; see `packaging/NOTES.md`. +standalone sources and `SHA256SUMS`. An `ubuntu-latest` runner with Docker +access is required; copy-based CI also supports sibling Docker daemons. +See `packaging/NOTES.md`. **Safety limitation:** legacy macro memory/configuration handling has known preexisting defects. Compatibility overlays do not repair the macro engine. diff --git a/packaging/NOTES.md b/packaging/NOTES.md index b145baf..502beff 100644 --- a/packaging/NOTES.md +++ b/packaging/NOTES.md @@ -78,8 +78,11 @@ and udev installation, macro help/version and purge cleanup. Source rebuilds install newly rebuilt dependencies, not binaries from the first build. Gitea CI (`.gitea/workflows/debian.yml`) builds on every push to `main` and -manual dispatch, using an `ubuntu-latest` runner with local Docker Engine. -The runner must expose the same workspace paths to Docker for read-only mounts. +manual dispatch, using an `ubuntu-latest` runner with Docker Engine access. +`ci.sh` copies only the build-input allowlist into disposable containers instead +of bind-mounting runner paths, supporting containerized runners with sibling +Docker daemons. The standalone rebuild receives only artifacts and its script. +Containers are removed on exit; their exit codes are explicitly checked. It uploads `debian13-amd64` artifacts using the Gitea-compatible v3 protocol; download the artifact from the successful run and check `SHA256SUMS`. Gitea does not run the GitHub CLI release job or publish release assets. diff --git a/packaging/ci.sh b/packaging/ci.sh new file mode 100644 index 0000000..e08b543 --- /dev/null +++ b/packaging/ci.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Copy-based isolation for containerized runners using a sibling Docker daemon. +set -euo pipefail +root=$(cd -- "$(dirname -- "$0")/.." && pwd) +out=$(realpath "${1:?empty output directory outside checkout required}") +[[ -d $out && -z $(find "$out" -mindepth 1 -print -quit) ]] || exit 1 +case $out in "$root"|"$root"/*) exit 1 ;; esac +[[ -d $root/.git ]] || exit 1 +image=${G15_BUILD_IMAGE:-g15-packaging} +build='' +rebuild='' +cleanup() { + [[ -z $build ]] || docker rm -f "$build" >/dev/null + [[ -z $rebuild ]] || docker rm -f "$rebuild" >/dev/null +} +trap cleanup EXIT +docker build -t "$image" -f "$root/packaging/Dockerfile" "$root/packaging" +build=$(docker create "$image" bash -c 'mkdir /out && shellcheck packaging/*.sh packaging/overlays/v1/*.sh && bash packaging/container-build.sh') +# Explicit allowlist: never copy editor settings, credentials or unrelated files. +for path in .git .gitmodules packaging libg15 libg15render g15daemon g15macro g15stats; do + docker cp "$root/$path" "$build:/work/$path" +done +docker start -a "$build" +[[ $(docker inspect -f '{{.State.ExitCode}}' "$build") == 0 ]] +docker cp "$build:/out/." "$out/" +rebuild=$(docker create "$image" bash -c 'apt-get update && bash /rebuild.sh /out') +docker cp "$out" "$rebuild:/out" +docker cp "$root/packaging/rebuild.sh" "$rebuild:/rebuild.sh" +docker start -a "$rebuild" +[[ $(docker inspect -f '{{.State.ExitCode}}' "$rebuild") == 0 ]] \ No newline at end of file