Files
runneros/.gitea/workflows/os.yml
T
Job79andClaude Opus 5.5 92a21ae607 Sign updates
The os workflow signs SHA256SUMS with the SIGNING_KEY secret and publishes
SHA256SUMS.gpg next to it. systemd-sysupdate now verifies it (Verify=yes)
against import-pubring.pgp, so hosts only install updates we built.

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

51 lines
2.0 KiB
YAML

# git-runner OS image
#
# Builds the OS image, with the job image inside, and publishes it as version "latest" of the
# generic package git-runner, where runners fetch their updates (mkosi.extra/usr/lib/sysupdate.d).
# Runs on every push, weekly for Fedora updates, and by hand, on our own job image: if a change
# breaks it, build the fix locally (see README.md).
name: os
on:
push:
branches: [main]
schedule:
- cron: "0 2 * * 0" # weekly (Sunday), picks up Fedora updates
workflow_dispatch: # run by hand, e.g. for a CVE
jobs:
os:
runs-on: linux
env:
PKG: ${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/git-runner/latest
AUTH: "Authorization: token ${{ github.token }}"
steps:
- name: Install tools
run: dnf install -yq mkosi
- name: Check out
uses: builtin:checkout
- name: Build
run: mkosi build
- name: Compress
working-directory: mkosi.output
run: |
zstd -q --rm -T0 -19 git-runner_*.root-*.raw
qemu-img convert -c -O qcow2 "$(basename git-runner_*.efi .efi).raw" git-runner.qcow2
sha256sum git-runner_*.efi git-runner_*.root-*.raw.zst > SHA256SUMS
# Signs SHA256SUMS with the key whose public half is mkosi.extra/usr/lib/systemd/import-pubring.pgp.
- 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
# Replaces the previous version. SHA256SUMS goes last: until it's there, runners find no update.
- name: Publish
working-directory: mkosi.output
run: |
curl -fsS -H "$AUTH" -X DELETE "$PKG" || true
for f in git-runner_*.efi git-runner_*.root-*.raw.zst git-runner.qcow2 SHA256SUMS.gpg SHA256SUMS; do
curl -fsS -o /dev/null -H "$AUTH" --upload-file "$f" "$PKG/$f"
done