Files
agentos/.gitea/workflows/os.yml
T
Job79andClaude Opus 5.5 4a296883dc fix: publish with PACKAGE_TOKEN, new update signing key
These missed PR #2, which was merged before them.

Gitea gives the job token at most read access to a user's packages, so
Publish uses the PACKAGE_TOKEN secret, a token with only write:package.
The permissions block never helped and goes.

The update signing key is new ("agentos updates"). The old one was a copy
of runneros's ("git-runner updates") and its private half is lost. The
SIGNING_KEY secret already holds the new key. VMs installed with the old
key need a reinstall to take updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:48:23 +00:00

63 lines
2.3 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.
# - PACKAGE_TOKEN repository secret: a token of the package owner with only
# write:package. The job token can't write packages.
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
- name: Check out
uses: actions/checkout@v7
- 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 agentos_*.usr-*.raw
- name: Checksum
working-directory: mkosi.output
run: sha256sum agentos_*.efi agentos_*.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 agentos_*.efi .efi).raw" agentos.qcow2
- name: Publish
working-directory: mkosi.output
env:
PKG: ${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/agentos/latest
AUTH: "Authorization: token ${{ secrets.PACKAGE_TOKEN }}"
run: |
curl -fsS -H "$AUTH" -X DELETE "$PKG" || true
for f in agentos_*.efi agentos_*.usr-*.raw.zst agentos.qcow2 agentos_*.manifest SHA256SUMS.gpg SHA256SUMS; do
curl -fsS -o /dev/null -H "$AUTH" --upload-file "$f" "$PKG/$f"
done