os / os (push) Canceled after 0s
- Follow AGENTS.md style: headers start with the file's name, short notes are full sentences, comments within 80 columns. - Build with mkosi's tools tree, pinned to the image's release (ToolsTreeRelease=%r): rawhide's repositories made the image rawhide. - Incremental builds with mkosi.cache/ for faster local rebuilds. - Hostname= instead of systemd.hostname= on the kernel command line. - mkosi.finalize: bash, no cd, and L+ for /etc/systemd. PID 1 applies the presets at first boot and made /etc/systemd/system, which blocked the link, so /etc/systemd/user (the user's D-Bus) was missing. - Disable homed, userdbd and nsresourced with presets instead of deleting their units. Drop modules the kernel has built in. - mkosi.version adds the git commit to the version. - One dev container per worktree or session in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
61 lines
2.2 KiB
YAML
61 lines
2.2 KiB
YAML
# os.yml builds the OS image and publishes it as version "latest". VMs fetch
|
|
# the built images as updates (mkosi.extra/usr/lib/sysupdate.d). It 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
|
|
steps:
|
|
- name: Install tools
|
|
run: dnf install -yq mkosi git-core
|
|
- 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_*.usr-*.raw
|
|
- name: Checksum
|
|
working-directory: mkosi.output
|
|
run: sha256sum agent_*.efi agent_*.usr-*.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: Build qcow2
|
|
working-directory: mkosi.output
|
|
run: qemu-img convert -c -O qcow2 "$(basename agent_*.efi .efi).raw" agent.qcow2
|
|
- name: Publish
|
|
working-directory: mkosi.output
|
|
env:
|
|
PKG: ${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/agent/latest
|
|
AUTH: "Authorization: token ${{ gitea.token }}"
|
|
run: |
|
|
curl -fsS -H "$AUTH" -X DELETE "$PKG" || true
|
|
for f in agent_*.efi agent_*.usr-*.raw.zst agent.qcow2 agent_*.manifest SHA256SUMS.gpg SHA256SUMS; do
|
|
curl -fsS -o /dev/null -H "$AUTH" --upload-file "$f" "$PKG/$f"
|
|
done
|