Support sibling Docker daemons in Gitea package builds
Debian 13 packages / build (push) Successful in 3m48s
Debian 13 packages / build (push) Successful in 3m48s
This commit is contained in:
1 parent
ef5d81fd20
commit
9b6443aa33
4 files changed
+39
-7
No files matched your search
@@ -22,9 +22,7 @@ jobs:
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
for script in packaging/*.sh packaging/overlays/v1/*.sh; do bash -n "$script"; done
|
for script in packaging/*.sh packaging/overlays/v1/*.sh; do bash -n "$script"; done
|
||||||
mkdir -p "$RUNNER_TEMP/debs"
|
mkdir -p "$RUNNER_TEMP/debs"
|
||||||
bash packaging/run.sh "$RUNNER_TEMP/debs"
|
bash packaging/ci.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
|
|
||||||
test -z "$(git submodule foreach --quiet --recursive 'git status --porcelain')"
|
test -z "$(git submodule foreach --quiet --recursive 'git status --porcelain')"
|
||||||
- name: Upload verified binaries and standalone sources
|
- name: Upload verified binaries and standalone sources
|
||||||
uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3 (Gitea artifact protocol)
|
uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3 (Gitea artifact protocol)
|
||||||
|
|||||||
@@ -25,8 +25,9 @@ Use the verified Debian source artifacts instead.
|
|||||||
|
|
||||||
Gitea Actions builds all five projects on pushes to `main` and manual dispatch.
|
Gitea Actions builds all five projects on pushes to `main` and manual dispatch.
|
||||||
Successful runs provide the `debian13-amd64` artifact, including binaries,
|
Successful runs provide the `debian13-amd64` artifact, including binaries,
|
||||||
standalone sources and `SHA256SUMS`. An `ubuntu-latest` runner with local Docker
|
standalone sources and `SHA256SUMS`. An `ubuntu-latest` runner with Docker
|
||||||
and matching workspace mount paths is required; see `packaging/NOTES.md`.
|
access is required; copy-based CI also supports sibling Docker daemons.
|
||||||
|
See `packaging/NOTES.md`.
|
||||||
|
|
||||||
**Safety limitation:** legacy macro memory/configuration handling has known
|
**Safety limitation:** legacy macro memory/configuration handling has known
|
||||||
preexisting defects. Compatibility overlays do not repair the macro engine.
|
preexisting defects. Compatibility overlays do not repair the macro engine.
|
||||||
|
|||||||
+5
-2
@@ -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.
|
install newly rebuilt dependencies, not binaries from the first build.
|
||||||
|
|
||||||
Gitea CI (`.gitea/workflows/debian.yml`) builds on every push to `main` and
|
Gitea CI (`.gitea/workflows/debian.yml`) builds on every push to `main` and
|
||||||
manual dispatch, using an `ubuntu-latest` runner with local Docker Engine.
|
manual dispatch, using an `ubuntu-latest` runner with Docker Engine access.
|
||||||
The runner must expose the same workspace paths to Docker for read-only mounts.
|
`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;
|
It uploads `debian13-amd64` artifacts using the Gitea-compatible v3 protocol;
|
||||||
download the artifact from the successful run and check `SHA256SUMS`.
|
download the artifact from the successful run and check `SHA256SUMS`.
|
||||||
Gitea does not run the GitHub CLI release job or publish release assets.
|
Gitea does not run the GitHub CLI release job or publish release assets.
|
||||||
|
|||||||
@@ -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 ]]
|
||||||
Reference in new issue
Block a user