diff --git a/bin/setup b/bin/setup index 7b1427c..87317e6 100755 --- a/bin/setup +++ b/bin/setup @@ -192,9 +192,41 @@ else fi echo "" +# --- rc branch worktree ------------------------------------------------------- + +# The rc channel builds from the standing `rc` branch (where the release +# orchestrator commits RC PKGBUILD pins) in its own worktree, so rc builds +# never contend with the master checkout. OMARCHY_REPO_ROOT in the rc service +# points its published tree back at this checkout, so all three channels live +# together. +RC_WORKTREE="/root/omarchy-pkgs-rc" + +if [[ "$CHECK_ONLY" == true ]]; then + if [[ -d "$RC_WORKTREE" ]]; then + print_success "rc worktree present: $RC_WORKTREE" + else + print_warning "rc worktree would be created at $RC_WORKTREE" + fi +elif [[ -d "$RC_WORKTREE" ]]; then + print_success "rc worktree present: $RC_WORKTREE" +else + print_info "Creating rc branch worktree at $RC_WORKTREE..." + git -C "$BUILD_ROOT" fetch origin rc 2>/dev/null || true + if git -C "$BUILD_ROOT" show-ref --verify --quiet refs/heads/rc; then + git -C "$BUILD_ROOT" worktree add "$RC_WORKTREE" rc + elif git -C "$BUILD_ROOT" show-ref --verify --quiet refs/remotes/origin/rc; then + git -C "$BUILD_ROOT" worktree add --track -b rc "$RC_WORKTREE" origin/rc + else + print_warning "No rc branch exists yet — skipping worktree" + echo " The release orchestrator creates the rc branch on the first RC cut;" + echo " re-run bin/setup afterwards." + fi +fi +echo "" + # --- release timers ---------------------------------------------------------- -TIMERS=(omarchy-check-versions omarchy-auto-release-edge omarchy-auto-release-stable) +TIMERS=(omarchy-check-versions omarchy-auto-release-edge omarchy-auto-release-rc omarchy-auto-release-stable) if [[ "$SKIP_TIMERS" == true ]]; then print_info "Skipping release timers (--skip-timers)" diff --git a/systemd/omarchy-auto-release-rc.service b/systemd/omarchy-auto-release-rc.service new file mode 100644 index 0000000..84ad75f --- /dev/null +++ b/systemd/omarchy-auto-release-rc.service @@ -0,0 +1,17 @@ +[Unit] +Description=Auto-release omarchy-pkgs for rc mirror +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot +# The rc channel builds from the rc branch worktree, but publishes into the +# primary checkout's channel tree via OMARCHY_REPO_ROOT. +ExecStartPre=/usr/bin/git -C /root/omarchy-pkgs-rc pull --ff-only +ExecStart=/bin/bash -c 'source /root/.omarchy/build-credentials && /root/omarchy-pkgs-rc/bin/auto-release rc' +Environment=OMARCHY_STATE_DIR=/root/.state +Environment=OMARCHY_REPO_ROOT=/root/omarchy-pkgs/pkgs.omarchy.org +TimeoutStartSec=7200 + +[Install] +WantedBy=multi-user.target diff --git a/systemd/omarchy-auto-release-rc.timer b/systemd/omarchy-auto-release-rc.timer new file mode 100644 index 0000000..2108a38 --- /dev/null +++ b/systemd/omarchy-auto-release-rc.timer @@ -0,0 +1,12 @@ +[Unit] +Description=Retry pending rc releases every 6 hours + +[Timer] +# Backstop only: rc builds are normally triggered immediately over SSH by the +# release orchestrator (touch .sync-needed-rc + systemctl start). This timer +# retries builds whose state file survived a failure. +OnCalendar=*-*-* 01,07,13,19:00:00 America/New_York +Persistent=true + +[Install] +WantedBy=timers.target