Add skip_build

This commit is contained in:
Ryan Hughes
2026-07-13 19:55:23 -04:00
parent dc44a71eab
commit 515b566cb9
7 changed files with 57 additions and 16 deletions
+9 -2
View File
@@ -14,6 +14,7 @@ The filesystem no longer encodes release policy. Instead:
- packages with `"release_ring": "fast"` also build directly for `stable`
- all other packages reach `stable` by promoting tested edge artifacts with `bin/repo migrate`
- AUR sync behavior is controlled by `source`, `sync`, `aur`, patches, and hooks in `.omarchy/`
- packages can opt out of unscoped builds with `skip_build`; explicit `--package` builds remain available
## Prerequisites
### aarch64 Builds (Optional)
@@ -231,6 +232,10 @@ Minimal examples:
{ "source": "local" }
```
```json
{ "source": "local", "skip_build": true }
```
```json
{ "source": "aur", "pkgrel": { "suffix": 1 } }
```
@@ -241,13 +246,15 @@ Fields:
- `sync`: optional for AUR packages; defaults to `true`. Set `false` for AUR-origin packages that Omarchy maintains manually.
- `aur`: optional AUR package name when it differs from the local package directory, usually for split packages.
- `release_ring`: optional. `fast` means the package is built directly for stable as well as edge. Packages without a ring build in edge and reach stable through tested artifact promotion (`bin/repo migrate`).
- `skip_build`: optional boolean; defaults to `false`. Set `true` to exclude a package from scheduled version checks and unscoped builds. The package can still be built explicitly with `bin/repo release --package <name>`.
- `pkgrel`: optional Omarchy pkgrel suffix for a version-pinned rebuild bump. This emits `<aur pkgrel>.<suffix>` instead of replacing AUR's pkgrel. `offset` can be used only when preserving monotonic upgrades from old absolute pkgrel bumps. The metadata is removed automatically when AUR sync changes `pkgver`; the current package version is read from the checked-in PKGBUILD, so the version is not duplicated in JSON.
- `upstream_commit`: set by `bin/sync-aur` for AUR packages. Used by `bin/package-worktree` to recreate the exact raw AUR package that Omarchy last synced.
### Build Matrix
- **Edge builds** (`--mirror edge`): all packages in `pkgbuilds/*`
- **Stable builds** (`--mirror stable`): packages with `"release_ring": "fast"`
- **Edge unscoped builds** (`--mirror edge`): packages in `pkgbuilds/*` unless `"skip_build": true`
- **Stable unscoped builds** (`--mirror stable`): packages with `"release_ring": "fast"` unless `"skip_build": true`
- **Explicit builds** (`--package <name>`): the selected package, including packages with `"skip_build": true`, subject to mirror eligibility
- **Stable promotion** (`bin/repo migrate`): copies tested edge artifacts into stable
## Adding Packages
+4 -3
View File
@@ -54,8 +54,9 @@ while [[ $# -gt 0 ]]; do
echo " -h, --help Show this help message"
echo ""
echo "This script builds packages from pkgbuilds/ based on .omarchy/package.json:"
echo " --mirror edge: builds all packages"
echo " --mirror stable: builds packages with release_ring=fast only"
echo " --mirror edge: builds packages not marked skip_build=true"
echo " --mirror stable: builds fast-ring packages not marked skip_build=true"
echo " --package: explicitly builds selected packages, even with skip_build=true"
echo ""
echo "Or build specific packages with --package:"
echo " Package names should match directories in pkgbuilds/"
@@ -120,7 +121,7 @@ mkdir -p "$BUILD_OUTPUT_DIR"
if [[ -n "$PACKAGES" ]]; then
print_info "Building packages: $PACKAGES"
else
print_info "Building all packages for $MIRROR mirror"
print_info "Building unscoped packages for $MIRROR mirror"
fi
# Build/update the Docker image
+1 -1
View File
@@ -129,7 +129,7 @@ check_mirror() {
needs_build=true
packages+=("$pkg")
fi
done < <(packages_for_mirror "$mirror")
done < <(packages_for_unscoped_build "$mirror")
echo ""
+9 -6
View File
@@ -135,13 +135,14 @@ package_matches_filters() {
}
emit_package_json() {
local name="$1" source="$2" aur="$3" sync="$4" ring="$5" pkgrel="$6" upstream_commit="$7" patches="$8" hook="$9" version="${10}" path="${11}"
local name="$1" source="$2" aur="$3" sync="$4" skip_build="$5" ring="$6" pkgrel="$7" upstream_commit="$8" patches="$9" hook="${10}" version="${11}" path="${12}"
jq -n \
--arg name "$name" \
--arg source "$source" \
--arg aur "$aur" \
--arg sync "$sync" \
--arg skip_build "$skip_build" \
--arg release_ring "$ring" \
--argjson pkgrel "$pkgrel" \
--arg upstream_commit "$upstream_commit" \
@@ -149,7 +150,7 @@ emit_package_json() {
--arg hook "$hook" \
--arg version "$version" \
--arg path "$path" \
'{name: $name, source: $source, aur: $aur, sync: (if $sync == "" then null else $sync == "true" end), release_ring: $release_ring, pkgrel: $pkgrel, upstream_commit: $upstream_commit, patches: $patches, post_sync_hook: ($hook == "true"), version: $version, path: $path}'
'{name: $name, source: $source, aur: $aur, sync: (if $sync == "" then null else $sync == "true" end), skip_build: ($skip_build == "true"), release_ring: $release_ring, pkgrel: $pkgrel, upstream_commit: $upstream_commit, patches: $patches, post_sync_hook: ($hook == "true"), version: $version, path: $path}'
}
if [[ "$LIST_REPO" == true ]]; then
@@ -178,6 +179,7 @@ while IFS= read -r pkgdir; do
else
sync=""
fi
skip_build=$(jq -r 'if has("skip_build") then .skip_build else false end' "$metadata")
package_matches_filters "$source" "$sync" "$ring" || continue
@@ -191,11 +193,12 @@ while IFS= read -r pkgdir; do
version=$(get_pkgbuild_version "$pkgdir")
relpath=${pkgdir#"$BUILD_ROOT/"}
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \
"$name" \
"$source" \
"$aur_display" \
"$([[ -n "$sync" ]] && [[ "$sync" == true ]] && echo yes || ([[ "$sync" == false ]] && echo no || echo -))" \
"$([[ "$skip_build" == true ]] && echo yes || echo no)" \
"$ring" \
"$pkgrel_display" \
"$upstream_display" \
@@ -207,7 +210,7 @@ while IFS= read -r pkgdir; do
if [[ "$first_json" == false ]]; then
printf ',\n' >> "$json_file"
fi
emit_package_json "$name" "$source" "$aur" "$sync" "$ring" "$pkgrel" "$upstream_commit" "$patches" "$hook" "$version" "$relpath" >> "$json_file"
emit_package_json "$name" "$source" "$aur" "$sync" "$skip_build" "$ring" "$pkgrel" "$upstream_commit" "$patches" "$hook" "$version" "$relpath" >> "$json_file"
first_json=false
done < <(package_dirs)
@@ -220,11 +223,11 @@ fi
if command -v gum >/dev/null 2>&1; then
gum table --print --separator $'\t' \
--columns Package,Source,AUR,Sync,Release_Ring,Pkgrel,Upstream,Patches,Post_Sync,Version,Path \
--columns Package,Source,AUR,Sync,Skip_Build,Release_Ring,Pkgrel,Upstream,Patches,Post_Sync,Version,Path \
< "$rows_file"
else
{
printf 'Package\tSource\tAUR\tSync\tRelease_Ring\tPkgrel\tUpstream\tPatches\tPost_Sync\tVersion\tPath\n'
printf 'Package\tSource\tAUR\tSync\tSkip_Build\tRelease_Ring\tPkgrel\tUpstream\tPatches\tPost_Sync\tVersion\tPath\n'
cat "$rows_file"
} | column -t -s $'\t'
fi
+3 -2
View File
@@ -1,6 +1,7 @@
#!/bin/bash
# Build script - builds packages based on package metadata
# Edge builds all packages. Stable builds only packages in the fast release ring.
# Unscoped edge builds exclude skip_build packages. Stable also requires the fast release ring.
# Explicit --package selections may build packages with skip_build=true.
# Setup directories
ARCH=${ARCH:-x86_64}
@@ -412,7 +413,7 @@ check_needs_build() {
# Collect packages that should be built for the selected mirror
collect_packages() {
packages_for_mirror "$MIRROR"
packages_for_unscoped_build "$MIRROR"
}
# Main execution
+29 -1
View File
@@ -8,6 +8,7 @@
# { "source": "aur", "sync": false }
# { "source": "aur", "aur": "different-aur-name" }
# { "source": "aur", "release_ring": "fast" }
# { "source": "aur", "skip_build": true }
# { "source": "aur", "pkgrel": { "suffix": 1, "offset": 1 } }
# { "source": "local" }
#
@@ -75,6 +76,17 @@ package_is_fast_ring() {
[[ "$(package_release_ring "$pkgdir")" == "fast" ]]
}
package_build_skipped() {
local pkgdir="$1"
local metadata skip_build
metadata=$(metadata_file_for_dir "$pkgdir")
[[ -f "$metadata" ]] || return 1
skip_build=$(jq -r 'if has("skip_build") then .skip_build else false end' "$metadata")
[[ "$skip_build" == "true" ]]
}
package_has_metadata() {
local pkgdir="$1"
[[ -f "$(metadata_file_for_dir "$pkgdir")" ]]
@@ -133,6 +145,16 @@ packages_for_mirror() {
done
}
packages_for_unscoped_build() {
local mirror="$1"
package_dirs | while IFS= read -r pkgdir; do
if package_builds_for_mirror "$pkgdir" "$mirror" && ! package_build_skipped "$pkgdir"; then
basename "$pkgdir"
fi
done
}
package_extract_vcs_hash_from_version() {
local version="$1"
local version_no_pkgrel="${version%-*}"
@@ -212,7 +234,7 @@ package_git_upstream_hash() {
validate_package_metadata() {
local pkgdir="$1"
local metadata source sync aur ring pkgrel_type
local metadata source sync skip_build aur ring pkgrel_type
metadata=$(metadata_file_for_dir "$pkgdir")
[[ -f "$metadata" ]] || { echo "missing metadata: $metadata"; return 1; }
@@ -231,6 +253,12 @@ validate_package_metadata() {
*) echo "invalid sync for $(basename "$pkgdir"): must be boolean"; return 1 ;;
esac
skip_build=$(jq -r 'if has("skip_build") then .skip_build | type else "missing" end' "$metadata")
case "$skip_build" in
boolean|missing) ;;
*) echo "invalid skip_build for $(basename "$pkgdir"): must be boolean"; return 1 ;;
esac
aur=$(jq -r 'if has("aur") then .aur | type else "missing" end' "$metadata")
case "$aur" in
string|missing) ;;
+2 -1
View File
@@ -1,3 +1,4 @@
{
"source": "local"
"source": "local",
"skip_build": true
}