Add local Debian package + plain binary build task
Debian 13 packages / build (push) Successful in 3m50s
Debian 13 packages / build (push) Successful in 3m50s
Adds packaging/local-build.sh and packaging/extract-binaries.sh, reused by a new VS Code task, to populate gitignored dist/ and bin/ directories with the same build.sh/test.sh/run.sh scripts the Gitea and GitHub workflows run.
This commit is contained in:
1 parent
9b6443aa33
commit
9743898fa2
4 files changed
+102
No files matched your search
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# Extracts plain executables and shared libraries from built .deb artifacts.
|
||||
set -euo pipefail
|
||||
src=$(realpath "${1:?artifact directory required}")
|
||||
out=$(realpath "${2:?output binary directory required}")
|
||||
extract=$(mktemp -d)
|
||||
trap 'rm -rf "$extract"' EXIT
|
||||
shopt -s nullglob
|
||||
debs=("$src"/*.deb)
|
||||
[[ ${#debs[@]} -gt 0 ]] || { echo 'No .deb files found to extract' >&2; exit 1; }
|
||||
for deb in "${debs[@]}"; do
|
||||
dpkg-deb -x "$deb" "$extract"
|
||||
done
|
||||
mkdir -p "$out"
|
||||
for dir in "$extract/usr/bin" "$extract/usr/sbin"; do
|
||||
[[ -d $dir ]] || continue
|
||||
find "$dir" -mindepth 1 -maxdepth 1 -type f -exec cp {} "$out/" \;
|
||||
done
|
||||
[[ -d $extract/usr/lib ]] && find "$extract/usr/lib" -mindepth 2 -maxdepth 2 -type f -name '*.so*' -exec cp {} "$out/" \;
|
||||
true
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
# Populates repo-local dist/ (Debian packages) and bin/ (plain executables),
|
||||
# reusing the same scripts the Gitea and GitHub workflows run: build.sh and
|
||||
# test.sh directly when already inside the disposable packaging container
|
||||
# (e.g. this devcontainer), otherwise run.sh to build that container via Docker.
|
||||
set -euo pipefail
|
||||
root=$(cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
dist="$root/dist"
|
||||
bindir="$root/bin"
|
||||
work=$(mktemp -d)
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
if [[ -f /.dockerenv && $EUID == 0 ]]; then
|
||||
apt-get update
|
||||
bash "$root/packaging/build.sh" "$work"
|
||||
bash "$root/packaging/test.sh" "$work"
|
||||
else
|
||||
bash "$root/packaging/run.sh" "$work"
|
||||
fi
|
||||
rm -rf "$dist" "$bindir"
|
||||
mkdir -p "$dist" "$bindir"
|
||||
cp "$work"/* "$dist/"
|
||||
bash "$root/packaging/extract-binaries.sh" "$dist" "$bindir"
|
||||
echo "PASS: Debian packages in $dist, plain executables/libraries in $bindir"
|
||||
Reference in new issue
Block a user