Every pull request now builds the package directories it touches on ephemeral DigitalOcean droplets, and every merge to master publishes the resulting artifacts into the channels each package belongs to. The repository host's timers become the fallback rather than the pipeline. Build (.github/workflows/build-pr.yml) One job per package per architecture, always against edge. The artifact is labelled with the package directory's git tree hash. Tooling (bin/, helpers/, build/) is checked out from the base branch; the PR supplies only pkgbuilds/, so a PR can change what is built, never how. Builds run only for trusted authors: collaborators, .github/VOUCHED.td, or a PR carrying the build-approved label. A single required check, result, aggregates the matrix. Publish (.github/workflows/publish.yml, bin/publish-artifact) One job per merge. It collects the PR artifacts for the merged tree, builds anything that has none, then walks each channel/architecture slot once: pull that database, repo-add every package that belongs in it, upload packages, signatures, then the database. A published filename is immutable; identical bytes under an existing name only gain a database entry, different bytes are refused. Fast-ring packages reach edge, rc and stable in the same run from the same file. Matrix (bin/build-matrix) Package x architecture, with the channels the artifact ships to, decided by package_builds_for_mirror so CI and the host agree. arch=any packages build once and land in every architecture database. Builder (build/build.sh, bin/build, build/Dockerfile) With no local published tree, plan against and resolve from the public channel over HTTPS. PACKAGER is set to Omarchy. rclone is in the image. Runners (ci/) A controller droplet polls GitHub with curl and creates one g5 droplet per queued job from cloud-init, deleting them when off or over-age. Builders carry QEMU with credential support for aarch64. Operator SSH keys come from GitHub. tests/controller.sh and tests/publish-artifact.sh cover the decisions against fixtures and real makepkg output. Tests run on pull requests only; branch protection requires result, self-tests and build-isolation with up-to-date branches.
46 lines
1.9 KiB
YAML
46 lines
1.9 KiB
YAML
#cloud-config
|
|
# The always-on controller droplet (smallest size is fine). Clones the repo
|
|
# for ci/controller.sh, installs the unit and timer, and starts polling.
|
|
#
|
|
# Substitute before use:
|
|
# __REPO_URL__ https://github.com/omacom/omarchy-pkgs.git
|
|
# __BRANCH__ branch carrying ci/ (master once merged)
|
|
# __ENV_B64__ base64 of a filled-in controller.env.example
|
|
# __SSH_KEYS_JSON__ JSON array of public keys authorized for root
|
|
package_update: true
|
|
packages: [curl, jq, git]
|
|
|
|
# Root stays reachable by key so the journal can be read. Two things stand
|
|
# in the way on DO images: disable_root rewrites root's keys into a stub, and
|
|
# with no account ssh key attached DO expires root's password, which makes
|
|
# sshd refuse every non-interactive session with "password change required".
|
|
disable_root: false
|
|
chpasswd:
|
|
expire: false
|
|
ssh_authorized_keys: __SSH_KEYS_JSON__
|
|
|
|
users:
|
|
- name: controller
|
|
shell: /bin/bash
|
|
|
|
write_files:
|
|
# defer: write after the users module has created the controller group,
|
|
# otherwise chown to root:controller fails and the unit cannot read this.
|
|
- path: /etc/omarchy-controller.env
|
|
permissions: "0640"
|
|
owner: root:controller
|
|
encoding: b64
|
|
defer: true
|
|
content: __ENV_B64__
|
|
|
|
runcmd:
|
|
- chage -d "$(date +%F)" -M -1 root
|
|
- chown root:controller /etc/omarchy-controller.env && chmod 0640 /etc/omarchy-controller.env
|
|
- git clone --depth 1 --branch __BRANCH__ __REPO_URL__ /opt/omarchy-pkgs
|
|
- mkdir -p /run/omarchy-controller && chown controller:controller /run/omarchy-controller
|
|
- echo "d /run/omarchy-controller 0755 controller controller -" > /etc/tmpfiles.d/omarchy-controller.conf
|
|
# runcmd is executed by /bin/sh: no brace expansion.
|
|
- cp /opt/omarchy-pkgs/ci/controller-box/omarchy-controller.service /opt/omarchy-pkgs/ci/controller-box/omarchy-controller.timer /etc/systemd/system/
|
|
- systemctl daemon-reload
|
|
- systemctl enable --now omarchy-controller.timer
|