Update builds

This commit is contained in:
Ryan Hughes committed 2025-10-27 23:22:17 -04:00
1 parent c2feda64ee
commit 34297628a3
9 files changed
+115 -54

No files matched your search

+16 -10
View File
@@ -6,6 +6,8 @@ This repository manages the Omarchy Package Repository, building a host of PKGBU
The build system uses Docker to create a clean, reproducible build environment. Packages are built unsigned, then signed in a separate step, promoted to production, and synced to a remote server. The build system uses Docker to create a clean, reproducible build environment. Packages are built unsigned, then signed in a separate step, promoted to production, and synced to a remote server.
**Multi-Architecture Support**: The build system supports both **x86_64** and **aarch64** (ARM64) architectures. See [docs/AARCH64_BUILDS.md](docs/AARCH64_BUILDS.md) for aarch64 setup and usage.
### Directory Structure ### Directory Structure
``` ```
@@ -30,9 +32,10 @@ bin/repo release
With options: With options:
```bash ```bash
bin/repo release --skip-prod-check # Skip production confirmation bin/repo release --skip-prod-check # Skip production confirmation
bin/repo release --sync-remote dev-pkgs:/ # Sync to dev remote instead bin/repo release --sync-remote dev-pkgs:/ # Sync to dev remote instead
bin/repo release --package omarchy-nvim # Build only one package bin/repo release --package omarchy-nvim # Build only one package
bin/repo release --package yay cursor-bin omarchy-nvim # Build multiple packages
``` ```
### Step-by-Step Workflow ### Step-by-Step Workflow
@@ -72,8 +75,10 @@ Builds packages from `pkgbuilds/` directory in a Docker container.
**Examples:** **Examples:**
```bash ```bash
bin/repo build # Build all packages bin/repo build # Build all packages (x86_64)
bin/repo build --package omarchy-nvim # Build only yay bin/repo build --package omarchy-nvim # Build only one package
bin/repo build --package yay omarchy-nvim cursor-bin # Build multiple packages
bin/repo build --arch aarch64 # Build for ARM64/aarch64
``` ```
### `bin/repo sign` ### `bin/repo sign`
@@ -152,7 +157,7 @@ bin/repo sync pkgs.omarchy.org/x86_64 --remote dev-pkgs:/# Sync to dev
Runs the complete release workflow in sequence. Runs the complete release workflow in sequence.
**Options:** **Options:**
- `--package <name>` - Build only a specific package - `--package <names>` - Build only specific package(s) (space-separated)
- `--arch <arch>` - Target architecture (default: x86_64) - `--arch <arch>` - Target architecture (default: x86_64)
- `--sync-remote <path>` - Rclone remote for sync (default: production) - `--sync-remote <path>` - Rclone remote for sync (default: production)
- `--skip-prod-check` - Skip production confirmation - `--skip-prod-check` - Skip production confirmation
@@ -166,10 +171,11 @@ Runs the complete release workflow in sequence.
**Examples:** **Examples:**
```bash ```bash
bin/repo release # Full workflow bin/repo release # Full workflow
bin/repo release --skip-prod-check # Skip prod confirmation bin/repo release --skip-prod-check # Skip prod confirmation
bin/repo release --sync-remote dev-pkgs:/ # Sync to dev bin/repo release --sync-remote dev-pkgs:/ # Sync to dev
bin/repo release --package omarchy-nvim # Single package bin/repo release --package omarchy-nvim # Single package
bin/repo release --package yay cursor-bin omarchy-nvim # Multiple packages
``` ```
### Other Commands ### Other Commands
+23 -11
View File
@@ -26,15 +26,20 @@ while [[ $# -gt 0 ]]; do
shift 2 shift 2
;; ;;
--package) --package)
SINGLE_PACKAGE="$2" shift
shift 2 PACKAGES=""
while [[ $# -gt 0 && ! "$1" =~ ^-- ]]; do
PACKAGES="$PACKAGES $1"
shift
done
PACKAGES="${PACKAGES# }"
;; ;;
-h | --help) -h | --help)
echo "Usage: $0 [OPTIONS]" echo "Usage: $0 [OPTIONS]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)" echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
echo " --package <name> Build only the specified package (with optional options)" echo " --package <names> Build only the specified package(s) (space-separated)"
echo " -h, --help Show this help message" echo " -h, --help Show this help message"
echo "" echo ""
echo "This script builds AUR packages from:" echo "This script builds AUR packages from:"
@@ -47,8 +52,7 @@ while [[ $# -gt 0 ]]; do
echo "Examples:" echo "Examples:"
echo " $0 --arch aarch64" echo " $0 --arch aarch64"
echo " $0 --package yay" echo " $0 --package yay"
echo " $0 --package \"elephant install\"" echo " $0 --package yay elephant cursor-bin"
echo " $0 --package \"owner/repo skip-pgp\""
echo "" echo ""
exit 0 exit 0
;; ;;
@@ -69,18 +73,18 @@ print_info "Cleaning build workspace..."
rm -rf "$BUILD_OUTPUT_DIR"/* rm -rf "$BUILD_OUTPUT_DIR"/*
mkdir -p "$BUILD_OUTPUT_DIR" mkdir -p "$BUILD_OUTPUT_DIR"
# Check if AUR package list exists (only required if not building single package) # Check if AUR package list exists (only required if not building specific packages)
if [[ -z "$SINGLE_PACKAGE" ]]; then if [[ -z "$PACKAGES" ]]; then
if [[ ! -f "$BUILD_DIR/packages/omarchy-aur.packages" ]]; then if [[ ! -f "$BUILD_DIR/packages/omarchy-aur.packages" ]]; then
print_error "omarchy-aur.packages not found at $BUILD_DIR/packages/" print_error "omarchy-aur.packages not found at $BUILD_DIR/packages/"
exit 1 exit 1
fi fi
else else
print_info "Building single package: $SINGLE_PACKAGE" print_info "Building packages: $PACKAGES"
fi fi
# Build/update the Docker image # Build/update the Docker image
build_docker_image "$BUILD_DIR" build_docker_image "$BUILD_DIR" "$ARCH"
print_info "Running AUR package build..." print_info "Running AUR package build..."
@@ -92,7 +96,7 @@ make_dir_writable "$REPO_DIR"
DOCKER_ARGS=( DOCKER_ARGS=(
--rm --rm
-e ARCH="$ARCH" -e ARCH="$ARCH"
-e SINGLE_PACKAGE="$SINGLE_PACKAGE" -e PACKAGES="$PACKAGES"
-v "$BUILD_ROOT/build-output:/build-output" -v "$BUILD_ROOT/build-output:/build-output"
-v "$BUILD_ROOT/pkgs.omarchy.org:/pkgs.omarchy.org" -v "$BUILD_ROOT/pkgs.omarchy.org:/pkgs.omarchy.org"
-v "$BUILD_DIR:/build:ro" -v "$BUILD_DIR:/build:ro"
@@ -105,7 +109,15 @@ if [ -d "/var/cache/pacman/pkg" ]; then
fi fi
# Run the builder with assembled args # Run the builder with assembled args
docker run "${DOCKER_ARGS[@]}" omarchy-aur-builder:latest /build/build.sh IMAGE_TAG="omarchy-pkg-builder:latest-$ARCH"
PLATFORM_ARG=""
if [[ "$ARCH" == "aarch64" ]]; then
PLATFORM_ARG="--platform linux/arm64"
elif [[ "$ARCH" == "x86_64" ]]; then
PLATFORM_ARG="--platform linux/amd64"
fi
docker run $PLATFORM_ARG "${DOCKER_ARGS[@]}" "$IMAGE_TAG" /build/build.sh
BUILD_RESULT=$? BUILD_RESULT=$?
+6 -5
View File
@@ -72,20 +72,21 @@ else
echo "" echo ""
mkdir -p "$REPO_DIR" mkdir -p "$REPO_DIR"
# Copy all package files (excluding build database) # Move all package files (excluding build database)
COPIED=0 # Using mv instead of cp avoids filesystem sync issues and is atomic
MOVED=0
for pkg_file in *.pkg.tar.*; do for pkg_file in *.pkg.tar.*; do
# Skip build database files # Skip build database files
[[ "$pkg_file" == omarchy-build.db* ]] && continue [[ "$pkg_file" == omarchy-build.db* ]] && continue
if [[ -f "$pkg_file" ]]; then if [[ -f "$pkg_file" ]]; then
cp -v "$pkg_file" "$REPO_DIR/" mv -v "$pkg_file" "$REPO_DIR/"
COPIED=$((COPIED + 1)) MOVED=$((MOVED + 1))
fi fi
done done
echo "" echo ""
print_success "Promoted $COPIED file(s) to pkgs.omarchy.org" print_success "Promoted $MOVED file(s) to pkgs.omarchy.org"
# Cleanup build directory after successful promotion # Cleanup build directory after successful promotion
print_info "Cleaning up build directory..." print_info "Cleaning up build directory..."
+5 -5
View File
@@ -52,20 +52,20 @@ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 0 exit 0
fi fi
# Build/update the Docker image # Build/update the Docker image (always use x86_64 for removal - it's architecture independent)
build_docker_image "$BUILD_DIR" build_docker_image "$BUILD_DIR" "x86_64"
print_info "Removing package..." print_info "Removing package..."
# Ensure directory is writable by container user # Ensure directory is writable by container user
make_dir_writable "$REPO_DIR" make_dir_writable "$REPO_DIR"
# Run the removal script in Docker # Run the removal script in Docker (always use x86_64 image)
docker run --rm \ docker run --rm --platform linux/amd64 \
-e ARCH="$ARCH" \ -e ARCH="$ARCH" \
-v "$BUILD_ROOT/pkgs.omarchy.org:/pkgs.omarchy.org" \ -v "$BUILD_ROOT/pkgs.omarchy.org:/pkgs.omarchy.org" \
-v "$BUILD_DIR:/build:ro" \ -v "$BUILD_DIR:/build:ro" \
omarchy-aur-builder:latest /build/remove-package.sh "$PACKAGE_NAME" omarchy-pkg-builder:latest-x86_64 /build/remove-package.sh "$PACKAGE_NAME"
RESULT=$? RESULT=$?
+5 -5
View File
@@ -59,22 +59,22 @@ if [[ -z "$GPG_PASSPHRASE" ]]; then
exit 1 exit 1
fi fi
# Build/update the Docker image (reuse same image as build) # Build/update the Docker image (always use x86_64 for signing - it's architecture independent)
build_docker_image "$BUILD_DIR" build_docker_image "$BUILD_DIR" "x86_64"
print_info "Running package signing..." print_info "Running package signing..."
# Ensure output directory is writable by container user # Ensure output directory is writable by container user
make_dir_writable "$BUILD_OUTPUT_DIR" make_dir_writable "$BUILD_OUTPUT_DIR"
# Run the signing script in Docker # Run the signing script in Docker (always use x86_64 image)
docker run --rm \ docker run --rm --platform linux/amd64 \
-e ARCH="$ARCH" \ -e ARCH="$ARCH" \
-e GPG_PRIVATE_KEY="$GPG_PRIVATE_KEY" \ -e GPG_PRIVATE_KEY="$GPG_PRIVATE_KEY" \
-e GPG_PASSPHRASE="$GPG_PASSPHRASE" \ -e GPG_PASSPHRASE="$GPG_PASSPHRASE" \
-v "$BUILD_ROOT/build-output:/build-output" \ -v "$BUILD_ROOT/build-output:/build-output" \
-v "$BUILD_DIR:/build:ro" \ -v "$BUILD_DIR:/build:ro" \
omarchy-aur-builder:latest /build/sign.sh omarchy-pkg-builder:latest-x86_64 /build/sign.sh
SIGN_RESULT=$? SIGN_RESULT=$?
File renamed without changes.
+32 -12
View File
@@ -264,18 +264,38 @@ echo "==> Checking which packages need building..."
# First pass: determine which packages need building # First pass: determine which packages need building
PACKAGES_TO_BUILD=() PACKAGES_TO_BUILD=()
for pkgdir in /pkgbuilds/*/; do
[[ ! -d "$pkgdir" ]] && continue # If PACKAGES is specified, only check those packages
pkg=$(basename "$pkgdir") if [[ -n "$PACKAGES" ]]; then
[[ ! -f "$pkgdir/PKGBUILD" ]] && continue echo "==> Checking specified packages: $PACKAGES"
for pkg_name in $PACKAGES; do
if check_needs_build "$pkg"; then if [[ ! -f "/pkgbuilds/$pkg_name/PKGBUILD" ]]; then
PACKAGES_TO_BUILD+=("$pkg") echo "==> ERROR: Package '$pkg_name' not found in /pkgbuilds/"
else exit 1
echo " ✓ $pkg - already up to date" fi
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg"
fi if check_needs_build "$pkg_name"; then
done PACKAGES_TO_BUILD+=("$pkg_name")
else
echo " ✓ $pkg_name - already up to date"
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg_name"
fi
done
else
# Build all packages that need updates
for pkgdir in /pkgbuilds/*/; do
[[ ! -d "$pkgdir" ]] && continue
pkg=$(basename "$pkgdir")
[[ ! -f "$pkgdir/PKGBUILD" ]] && continue
if check_needs_build "$pkg"; then
PACKAGES_TO_BUILD+=("$pkg")
else
echo " ✓ $pkg - already up to date"
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg"
fi
done
fi
if [[ ${#PACKAGES_TO_BUILD[@]} -eq 0 ]]; then if [[ ${#PACKAGES_TO_BUILD[@]} -eq 0 ]]; then
echo "==> All packages are up to date!" echo "==> All packages are up to date!"
+2 -2
View File
@@ -72,10 +72,10 @@ for pkg_file in $PACKAGE_FILES; do
if gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \ if gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
--detach-sign --use-agent --no-armor --local-user "$KEY_ID" "$pkg_file" 2>/dev/null; then --detach-sign --use-agent --no-armor --local-user "$KEY_ID" "$pkg_file" 2>/dev/null; then
echo "✓" echo "✓"
((SIGNED_COUNT++)) SIGNED_COUNT=$((SIGNED_COUNT + 1))
else else
echo "✗" echo "✗"
((FAILED_COUNT++)) FAILED_COUNT=$((FAILED_COUNT + 1))
fi fi
done done
+26 -4
View File
@@ -17,8 +17,20 @@ check_docker() {
# Build the Docker image if needed # Build the Docker image if needed
build_docker_image() { build_docker_image() {
local build_dir="$1" local build_dir="$1"
print_info "Building Docker image..." local arch="${2:-x86_64}"
docker build -t omarchy-aur-builder:latest -f "$build_dir/Dockerfile" "$build_dir" local dockerfile="$build_dir/Dockerfile.$arch"
local platform=""
local image_tag="omarchy-pkg-builder:latest-$arch"
# Set platform for Docker build
if [[ "$arch" == "aarch64" ]]; then
platform="--platform linux/arm64"
elif [[ "$arch" == "x86_64" ]]; then
platform="--platform linux/amd64"
fi
print_info "Building Docker image for $arch..."
docker build $platform -t "$image_tag" -f "$dockerfile" "$build_dir"
} }
# Make directory writable by Docker container user # Make directory writable by Docker container user
@@ -34,8 +46,18 @@ make_dir_writable() {
# Run a Docker container with standard setup # Run a Docker container with standard setup
run_docker() { run_docker() {
local script="$1" local script="$1"
shift local arch="${2:-x86_64}"
shift 2
local -a args=("$@") local -a args=("$@")
local image_tag="omarchy-pkg-builder:latest-$arch"
local platform=""
docker run --rm "${args[@]}" omarchy-aur-builder:latest "$script" # Set platform for Docker run
if [[ "$arch" == "aarch64" ]]; then
platform="--platform linux/arm64"
elif [[ "$arch" == "x86_64" ]]; then
platform="--platform linux/amd64"
fi
docker run --rm $platform "${args[@]}" "$image_tag" "$script"
} }