v0.27.1 packaging update, install and initial config

This commit is contained in:
lixen committed 2026-10-06 00:14:05 -04:00
1 parent 60abc97eb0
commit 4513a9e62b
15 files changed
+431 -110

No files matched your search

+51 -14
View File
@@ -7,7 +7,7 @@ on:
- Dockerfile
- go.mod
- go.sum
- config/logwisp.toml
- config/**
- doc/lw.1
- deploy/package/**
- .github/workflows/package.yml
@@ -17,9 +17,9 @@ on:
permissions:
contents: read
jobs:
# The AUR package from this commit: makepkg finds the tarball the PKGBUILD
# names next to it and skips the download, then builds, tests and packages.
# checkout's safe.directory lasts only its own step; root owns .git here.
# make arch builds the AUR package from this checkout; the package installs
# over an edited configuration make install left, reinstalls keeping it, and
# goes. makepkg refuses root, so a user that owns the checkout runs it.
arch:
runs-on: ubuntu-latest
timeout-minutes: 20
@@ -28,24 +28,52 @@ jobs:
- run: pacman -Syu --noconfirm --needed git go
- uses: actions/checkout@v5
- run: |
ver=$(sed -n 's/^pkgver=//p' deploy/package/arch/PKGBUILD)
dir=$(mktemp -d)
git -c safe.directory="$PWD" archive --prefix="logwisp-$ver/" -o "$dir/logwisp-$ver.tar.gz" HEAD
cp deploy/package/arch/PKGBUILD "$dir"
useradd -m build
chown -R build "$dir"
su build -c "cd '$dir' && makepkg --noconfirm"
pacman -U --noconfirm "$dir"/logwisp-*.pkg.tar.zst
chown -R build .
su build -c 'make arch'
- run: |
for f in bin/arch/logwisp-*.pkg.tar.zst; do case $f in *-debug-*) ;; *) pkg=$f ;; esac; done
install -D -m 0644 config/logwisp.toml /etc/logwisp/logwisp.toml
echo '# edited' >> /etc/logwisp/logwisp.toml
pacman -U --noconfirm "$pkg"
test -f /etc/logwisp/logwisp.toml.pacnew
lw --version
test -f /usr/share/bash-completion/completions/lw
test -f /usr/share/zsh/site-functions/_lw
test -f /usr/share/fish/vendor_completions.d/lw.fish
pacman -U --noconfirm "$pkg"
grep -q '^# edited' /etc/logwisp/logwisp.toml
lw --check -c /etc/logwisp/logwisp.toml
pacman -R --noconfirm logwisp
test ! -e /usr/bin/lw
test -f /etc/logwisp/logwisp.toml.pacsave
# make install SERVICE=no into a home, twice, then lw config init places the
# configuration lw reads without -c, and never replaces it
user:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: make release
- run: |
make install SERVICE=no PREFIX="$HOME/.local"
make install SERVICE=no PREFIX="$HOME/.local"
export PATH="$HOME/.local/bin:$PATH"
test ! -e "$HOME/.local/lib/systemd/system/logwisp.service"
test ! -e /etc/logwisp/logwisp.toml
lw config init
lw --check
lw --dump | grep -q 'id = "default_source"'
if lw config init; then exit 1; fi
make uninstall PREFIX="$HOME/.local"
test ! -e "$HOME/.local/bin/lw"
test -f "$HOME/.config/logwisp/logwisp.toml"
# make deb on a host with systemd: the service runs from the package's
# configuration; remove stops and disables it and leaves the conffile, purge
# removes that too
# configuration and survives a reinstall that keeps an edited one; remove
# stops and disables it and leaves the conffile, purge removes that too
deb:
runs-on: ubuntu-latest
timeout-minutes: 10
@@ -62,6 +90,11 @@ jobs:
sudo systemctl enable --now logwisp
sleep 3
systemctl is-active logwisp || { sudo journalctl -u logwisp --no-pager; exit 1; }
echo '# edited' | sudo tee -a /etc/logwisp/logwisp.toml
sudo apt-get install --reinstall -y ./bin/logwisp_*.deb
grep -q '^# edited' /etc/logwisp/logwisp.toml
sleep 3
systemctl is-active logwisp || { sudo journalctl -u logwisp --no-pager; exit 1; }
sudo apt-get remove -y logwisp
test ! -e /usr/bin/lw
test ! -e /usr/lib/systemd/system/logwisp.service
@@ -70,7 +103,8 @@ jobs:
test -f /etc/logwisp/logwisp.toml
sudo apt-get purge -y logwisp
test ! -e /etc/logwisp/logwisp.toml
# BSD make on FreeBSD: build, install, run the rc.d service, uninstall
# BSD make on FreeBSD: build, install twice keeping an edited configuration,
# run the rc.d service, uninstall
freebsd:
runs-on: ubuntu-latest
timeout-minutes: 20
@@ -85,6 +119,9 @@ jobs:
set -e
make release
make install
echo '# edited' >> /usr/local/etc/logwisp/logwisp.toml
make install
grep -q '^# edited' /usr/local/etc/logwisp/logwisp.toml
lw --version
pw groupadd logwisp
pw useradd logwisp -g logwisp -d /nonexistent -s /usr/sbin/nologin