mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-18 11:40:18 +00:00
Refactor OpenBSD build workflow for clarity and efficiency
This commit is contained in:
committed by
GitHub
parent
d8460692ac
commit
758f879700
47
.github/workflows/openbsd-build.yml
vendored
47
.github/workflows/openbsd-build.yml
vendored
@@ -21,13 +21,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
release: '7.5'
|
release: '7.5'
|
||||||
usesh: true
|
usesh: true
|
||||||
sync: rsync # IMPORTANT: don't use `true`
|
sync: rsync
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
# Keep time sane
|
|
||||||
rdate -n pool.ntp.org
|
rdate -n pool.ntp.org
|
||||||
|
|
||||||
export PKG_PATH="https://ftp.openbsd.org/pub/OpenBSD/7.5/packages/$(uname -m)/"
|
export PKG_PATH="https://ftp.openbsd.org/pub/OpenBSD/7.5/packages/$(uname -m)/"
|
||||||
|
|
||||||
pkg_add -U \
|
pkg_add -U \
|
||||||
@@ -37,9 +35,9 @@ jobs:
|
|||||||
glib2 gtk+2 dbus-glib libcanberra \
|
glib2 gtk+2 dbus-glib libcanberra \
|
||||||
luajit mono libgdiplus openssl
|
luajit mono libgdiplus openssl
|
||||||
|
|
||||||
# Build on local disk (NOT the synced/mounted workspace)
|
|
||||||
work="$(mktemp -d /tmp/zoitechat.XXXXXX)"
|
work="$(mktemp -d /tmp/zoitechat.XXXXXX)"
|
||||||
trap 'rm -rf "$work"' EXIT
|
trap 'rm -rf "$work"' EXIT
|
||||||
|
|
||||||
rsync -a --delete "$GITHUB_WORKSPACE"/ "$work/src/"
|
rsync -a --delete "$GITHUB_WORKSPACE"/ "$work/src/"
|
||||||
cd "$work/src"
|
cd "$work/src"
|
||||||
|
|
||||||
@@ -55,33 +53,54 @@ jobs:
|
|||||||
|
|
||||||
staging="$work/staging"
|
staging="$work/staging"
|
||||||
rm -rf "$staging"
|
rm -rf "$staging"
|
||||||
DESTDIR="$staging" ninja -C build install
|
mkdir -p "$staging"
|
||||||
|
|
||||||
|
# Staged install
|
||||||
|
DESTDIR="$staging" meson install -C build --no-rebuild
|
||||||
|
|
||||||
|
# If these exist, something ignored DESTDIR (install scripts are leaking)
|
||||||
|
ls -l /usr/local/bin/zoitechat /usr/local/bin/thememan 2>/dev/null || true
|
||||||
|
|
||||||
# Force flush in case the FS is weird
|
|
||||||
sync
|
sync
|
||||||
|
sleep 1
|
||||||
|
sync
|
||||||
|
|
||||||
|
# Freeze staged tree so pkg_create doesn't see moving targets
|
||||||
|
snap="$work/staging-snap"
|
||||||
|
rm -rf "$snap"
|
||||||
|
mkdir -p "$snap"
|
||||||
|
(cd "$staging" && pax -rw -pe . "$snap")
|
||||||
|
|
||||||
version="$(meson introspect --projectinfo build | sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')"
|
version="$(meson introspect --projectinfo build | sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')"
|
||||||
pkg_name="zoitechat-${version}"
|
pkg_name="zoitechat-${version}"
|
||||||
plist="$work/openbsd-plist"
|
plist="$work/openbsd-plist"
|
||||||
|
desc="$work/DESCR"
|
||||||
|
|
||||||
|
cat >"$desc" <<'EOF'
|
||||||
|
ZoiteChat is an IRC client (HexChat-derived) with a GTK UI and optional tools.
|
||||||
|
EOF
|
||||||
|
|
||||||
{
|
{
|
||||||
echo "@name ${pkg_name}"
|
echo "@name ${pkg_name}"
|
||||||
echo "@comment OpenBSD package built by GitHub Actions"
|
|
||||||
echo "@cwd /usr/local"
|
echo "@cwd /usr/local"
|
||||||
|
|
||||||
# Files + symlinks
|
find "$snap/usr/local" \( -type f -o -type l \) -print \
|
||||||
find "$staging/usr/local" \( -type f -o -type l \) -print \
|
|
||||||
| LC_ALL=C sort \
|
| LC_ALL=C sort \
|
||||||
| sed "s#^$staging/usr/local/##"
|
| sed "s#^$snap/usr/local/##"
|
||||||
|
|
||||||
# Directories (reverse so children removed first)
|
find "$snap/usr/local" -mindepth 1 -type d -print \
|
||||||
find "$staging/usr/local" -mindepth 1 -type d -print \
|
|
||||||
| LC_ALL=C sort -r \
|
| LC_ALL=C sort -r \
|
||||||
| sed "s#^$staging/usr/local/##" \
|
| sed "s#^$snap/usr/local/##" \
|
||||||
| sed 's#^#@dir #'
|
| sed 's#^#@dir #'
|
||||||
} > "$plist"
|
} > "$plist"
|
||||||
|
|
||||||
pkg_create -B "$staging" -p /usr/local -f "$plist" -U "$work/${pkg_name}.tgz"
|
pkg_create \
|
||||||
|
-B "$snap" \
|
||||||
|
-p /usr/local \
|
||||||
|
-f "$plist" \
|
||||||
|
-c "ZoiteChat IRC client" \
|
||||||
|
-d "$desc" \
|
||||||
|
"$work/${pkg_name}.tgz"
|
||||||
|
|
||||||
mkdir -p "$GITHUB_WORKSPACE/artifacts"
|
mkdir -p "$GITHUB_WORKSPACE/artifacts"
|
||||||
cp "$work/${pkg_name}.tgz" "$GITHUB_WORKSPACE/artifacts/"
|
cp "$work/${pkg_name}.tgz" "$GITHUB_WORKSPACE/artifacts/"
|
||||||
|
|||||||
Reference in New Issue
Block a user