df005e2963
android / android (push) Failing after 22s
deb / build-publish (push) Failing after 0s
decky / build-publish (push) Failing after 0s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Failing after 1s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Failing after 0s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Failing after 1s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Failing after 0s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Failing after 0s
flatpak / build-publish (push) Failing after 1s
docker / deploy-docs (push) Has been skipped
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Failing after 0s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Failing after 0s
apple / swift (push) Successful in 53s
ci / web (push) Successful in 28s
ci / docs-site (push) Successful in 34s
ci / bench (push) Successful in 1m32s
ci / rust (push) Failing after 53s
Every user needs the console for pairing, so ship it via apt, auto-wired to the host — no manual bun/env setup. New punktfunk-web .deb (Architecture: all, Depends: nodejs >= 20 — runs the node-server build under apt-native node, no bundled bun): - packaging/debian/build-web-deb.sh: stages web/.output (server + public) + a /usr/bin/punktfunk-web-server wrapper (node) + the systemd --user units + the web.env template + docs. Refuses a bun bundle (Bun.serve) as a wrong-preset guard. - scripts/punktfunk-web.service: --user unit on :3000, EnvironmentFile sources the host's ~/.config/punktfunk/mgmt-token (the shared bearer) + the generated web-password; sets PUNKTFUNK_MGMT_URL=https://127.0.0.1:47990 + NODE_TLS_REJECT_UNAUTHORIZED=0 (loopback self-signed cert). Restart=on-failure rides out the host-writes-token-first ordering. - scripts/punktfunk-web-init.service + web-init.sh: --user one-shot that generates the login password (a .deb postinst runs as root → wrong $HOME) and surfaces it to the journal. - build-deb.sh: punktfunk-host now Recommends punktfunk-web (apt pulls it by default; headless boxes opt out with --no-install-recommends). - deb.yml: build the web console + smoke-boot it under node (gate the .deb on a real /login 200) + build-web-deb.sh; the publish loop globs it automatically. - web/{.env.example,web.env.example}: document the auto-wiring vs a manual deploy. End state: `apt install punktfunk-host` pulls punktfunk-web; enable both --user services; the console logs in (password from the journal) and proxies the host's HTTPS mgmt API with the shared token — zero hand-edited env. Local .deb build + node smoke-boot verified. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
112 lines
4.5 KiB
YAML
112 lines
4.5 KiB
YAML
# Build the punktfunk-host and punktfunk-client .debs and publish them to Gitea's Debian
|
|
# package registry, so Ubuntu boxes get new builds via `apt update && apt upgrade`. Runs
|
|
# inside the same Ubuntu 26.04 rust-ci builder image as ci.yml, so dpkg-shlibdeps pins the
|
|
# runtime lib package names (libavcodec62, libpipewire-0.3-0t64, …) to exactly what the
|
|
# target boxes run.
|
|
#
|
|
# Registry (public, unom org): https://git.unom.io/unom/-/packages
|
|
# Box setup (once): see packaging/debian/README.md
|
|
#
|
|
# REGISTRY_TOKEN: repo Actions secret, a PAT with write:package scope (shared with docker.yml).
|
|
name: deb
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
REGISTRY: git.unom.io
|
|
OWNER: unom
|
|
DISTRIBUTION: stable
|
|
COMPONENT: main
|
|
|
|
jobs:
|
|
build-publish:
|
|
runs-on: ubuntu-24.04
|
|
container:
|
|
image: git.unom.io/unom/punktfunk-rust-ci:latest
|
|
timeout-minutes: 90
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# dpkg-shlibdeps (Depends resolution) + dpkg-deb live in dpkg-dev. The client's link
|
|
# deps are also baked into the rust-ci image, but this job runs against the image
|
|
# from the PREVIOUS push (docker.yml bootstrap note) — keep it green across image
|
|
# changes; a no-op once the image has them.
|
|
- name: dpkg-dev + client link deps
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends dpkg-dev \
|
|
libgtk-4-dev libadwaita-1-dev libsdl3-dev
|
|
|
|
# Share ci.yml's cache keys so the release build reuses its registry + target artifacts.
|
|
- name: Cache keys
|
|
run: echo "rustc=$(rustc --version | cut -d' ' -f2)" >> "$GITHUB_ENV"
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
/usr/local/cargo/registry
|
|
/usr/local/cargo/git
|
|
key: cargo-home-${{ hashFiles('Cargo.lock') }}
|
|
restore-keys: cargo-home-
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: target
|
|
key: cargo-target-${{ env.rustc }}-${{ hashFiles('Cargo.lock') }}
|
|
restore-keys: cargo-target-${{ env.rustc }}-
|
|
|
|
- name: Build release host + client
|
|
run: |
|
|
git config --global --add safe.directory "$PWD"
|
|
cargo build --release -p punktfunk-host -p punktfunk-client-linux --locked
|
|
|
|
- name: Build + smoke-boot web console (node-server preset)
|
|
# Gate the .deb on a real node boot: the punktfunk-web .deb runs `node .output/server`,
|
|
# so prove the node-server build exists, isn't a bun bundle, and actually serves /login.
|
|
run: |
|
|
cd web
|
|
bun install --frozen-lockfile
|
|
bun run build
|
|
if grep -q 'Bun\.serve' .output/server/index.mjs; then
|
|
echo "ERROR: web build is a bun bundle (Bun.serve) — need the node-server preset"; exit 1
|
|
fi
|
|
PORT=3009 HOST=127.0.0.1 PUNKTFUNK_UI_PASSWORD=ci node .output/server/index.mjs &
|
|
NP=$!; sleep 3
|
|
code=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3009/login || echo 000)
|
|
kill "$NP" 2>/dev/null || true
|
|
echo "web console smoke: /login -> $code"
|
|
[ "$code" = 200 ] || { echo "ERROR: web console failed to boot under node"; exit 1; }
|
|
|
|
- name: Version
|
|
# Tag v1.2.3 -> 1.2.3 (a real release); a main push -> 0.0.1~ciN.g<sha>, which sorts
|
|
# BEFORE 0.0.1 (the '~') yet monotonically increases by run number, so `apt upgrade`
|
|
# always moves the boxes to the newest main build.
|
|
run: |
|
|
SHORT=$(echo "$GITHUB_SHA" | cut -c1-8)
|
|
case "$GITHUB_REF" in
|
|
refs/tags/v*) V="${GITHUB_REF_NAME#v}" ;;
|
|
*) V="0.0.1~ci${GITHUB_RUN_NUMBER}.g${SHORT}" ;;
|
|
esac
|
|
echo "VERSION=$V" >> "$GITHUB_ENV"
|
|
echo "package version $V"
|
|
|
|
- name: Build .debs
|
|
run: |
|
|
VERSION="$VERSION" bash packaging/debian/build-deb.sh
|
|
VERSION="$VERSION" bash packaging/debian/build-client-deb.sh
|
|
VERSION="$VERSION" bash packaging/debian/build-web-deb.sh
|
|
|
|
- name: Publish to the Gitea apt registry
|
|
env:
|
|
TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
run: |
|
|
for DEB in dist/*.deb; do
|
|
echo "uploading $DEB"
|
|
# PAT owner (enricobuehler), not the push actor — matches docker.yml's registry login.
|
|
curl -fsS --user "enricobuehler:$TOKEN" --upload-file "$DEB" \
|
|
"https://$REGISTRY/api/packages/$OWNER/debian/pool/$DISTRIBUTION/$COMPONENT/upload"
|
|
done
|
|
echo "published to $OWNER/debian $DISTRIBUTION/$COMPONENT"
|