Files
agentos/.gitea/workflows/os.yml
T
Job79andClaude Opus 5.5 db8fb0d5a4 feat: root adds the ssh keys, mkosi ssh for the test VM
The setup no longer asks for an ssh key. Root logs in on the console and
adds keys for claude and root to /var/lib/agent. Root may log in with
ssh, and its home is a tmpfs that is wiped at every boot. The test VM
uses mkosi ssh instead of a forwarded port, so the agent.ssh-key
credential is gone.

Also mount /var with noatime, move STYLE.md into AGENTS.md and rewrite
comments to start with the name of what they describe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 19:10:54 +01:00

59 lines
2.0 KiB
YAML

# OS image
#
# Builds the OS image and publishes it as version "latest". VMs fetch the
# built images as updates (mkosi.extra/usr/lib/sysupdate.d). Runs on every
# push, weekly for package updates, and by hand for critical CVEs.
#
# Required values:
# - SECUREBOOT_KEY repository secret: the private key of mkosi.crt, written
# to mkosi.key.
# - SIGNING_KEY repository secret: the armored private gpg key whose
# public half is mkosi.extra/usr/lib/systemd/
# import-pubring.pgp, which systemd-sysupdate checks.
name: os
on:
push:
branches: [main]
schedule:
- cron: "0 2 * * 0"
workflow_dispatch:
jobs:
os:
runs-on: linux
env:
PKG: ${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/agent/latest
AUTH: "Authorization: token ${{ gitea.token }}"
steps:
- name: Install tools
run: dnf install -yq mkosi sbsigntools
- name: Check out
uses: builtin:checkout
- name: Build
env:
KEY: ${{ secrets.SECUREBOOT_KEY }}
run: |
(umask 077 && printf '%s\n' "$KEY" > mkosi.key)
mkosi build
- name: Compress
working-directory: mkosi.output
run: |
zstd -q --rm -9 agent_*.root-*.raw
qemu-img convert -c -m 16 -W -O qcow2 "$(basename agent_*.efi .efi).raw" agent.qcow2
sha256sum agent_*.efi agent_*.root-*.raw.zst > SHA256SUMS
- name: Sign
working-directory: mkosi.output
env:
KEY: ${{ secrets.SIGNING_KEY }}
run: |
export GNUPGHOME=$(mktemp -d)
gpg -q --batch --import <<< "$KEY"
gpg -q --batch -o SHA256SUMS.gpg --detach-sign SHA256SUMS
- name: Publish
working-directory: mkosi.output
run: |
curl -fsS -H "$AUTH" -X DELETE "$PKG" || true
for f in agent_*.efi agent_*.root-*.raw.zst agent.qcow2 agent_*.manifest SHA256SUMS.gpg SHA256SUMS; do
curl -fsS -o /dev/null -H "$AUTH" --upload-file "$f" "$PKG/$f"
done