Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions .github/workflows/build-aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: aarch64 package repo

# Build an aarch64 Omarchy repository for manual or reusable workflows.

on:
workflow_dispatch:
inputs:
packages:
description: "Space-separated pkgbases to build (empty = every eligible package)"
type: string
default: ""
mirror:
description: "edge or stable"
type: string
default: edge
workflow_call:
inputs:
pkgs_repository:
description: "owner/name of the omarchy-pkgs checkout to build"
type: string
required: true
pkgs_ref:
description: "branch, tag or SHA of that repository"
type: string
required: true
packages:
type: string
default: ""
mirror:
type: string
default: edge
outputs:
artifact:
description: "Name of the uploaded repository artifact"
value: ${{ jobs.build.outputs.artifact }}

jobs:
build:
runs-on: ubuntu-24.04-arm
timeout-minutes: 300
outputs:
artifact: ${{ steps.meta.outputs.artifact }}
env:
ARCH: aarch64
INPUT_MIRROR: ${{ inputs.mirror }}
INPUT_PACKAGES: ${{ inputs.packages }}
steps:
- name: Checkout omarchy-pkgs
uses: actions/checkout@v4
with:
repository: ${{ inputs.pkgs_repository || github.repository }}
ref: ${{ inputs.pkgs_ref || github.ref }}

- name: Resolve inputs
id: meta
run: |
MIRROR="${INPUT_MIRROR:-edge}"
PACKAGES="$INPUT_PACKAGES"
case "$MIRROR" in edge|stable) ;; *) echo "invalid mirror: $MIRROR" >&2; exit 1 ;; esac
re='^[A-Za-z0-9._+ -]+$'
if ! [[ $PACKAGES =~ $re ]]; then echo "invalid package list" >&2; exit 1; fi
{
echo "MIRROR=$MIRROR"
echo "PACKAGES=$PACKAGES"
echo "REPO_DIR=pkgs.omarchy.org/$MIRROR/$ARCH"
echo "OUTPUT_DIR=build-output/$MIRROR/$ARCH"
} >> "$GITHUB_ENV"
echo "artifact=omarchy-repo-$ARCH-$MIRROR" >> "$GITHUB_OUTPUT"

- name: Runner facts
run: |
set -x
uname -a
nproc
free -h
df -h / /mnt 2>/dev/null || df -h /
docker version
docker buildx version
docker info --format '{{.Driver}} {{.DockerRootDir}}'
id

# Reuse packages whose build inputs have not changed.
- name: Restore repository tree
uses: actions/cache@v4
with:
path: ${{ env.REPO_DIR }}
key: omarchy-repo-${{ env.ARCH }}-${{ env.MIRROR }}-${{ hashFiles('pkgbuilds/**/PKGBUILD', 'pkgbuilds/**/.omarchy/**') }}
restore-keys: |
omarchy-repo-${{ env.ARCH }}-${{ env.MIRROR }}-

# The builder and runner use different user IDs.
- name: Prepare output directories
run: |
mkdir -p "$OUTPUT_DIR" "$REPO_DIR" src logs
chmod -R a+rwX build-output pkgs.omarchy.org src

- name: Build plan
run: bin/repo build --arch "$ARCH" --mirror "$MIRROR" --dry-run --package $PACKAGES

- name: Build packages
run: |
start=$(date +%s)
bin/repo build --arch "$ARCH" --mirror "$MIRROR" --package $PACKAGES
echo "build wall-clock: $(( $(date +%s) - start ))s"

# Replaces bin/repo sign + promote, which need the repository host's key.
- name: Publish into the repository tree and write omarchy.db
run: |
shopt -s nullglob
files=("$OUTPUT_DIR"/*.pkg.tar.*)
echo "new package files: ${#files[@]}"
[[ ${#files[@]} -gt 0 ]] && cp -v "${files[@]}" "$REPO_DIR/"
chmod -R a+rwX pkgs.omarchy.org
bin/repo update --arch "$ARCH" --mirror "$MIRROR"

- name: Verify repository
run: |
cd "$REPO_DIR"
ls -la
echo "== packages in omarchy.db =="
tar --use-compress-program=unzstd -tf omarchy.db.tar.zst | grep '/$' | sed 's|/$||' | sort
echo "== missing from the requested set =="
missing=0
for p in $PACKAGES; do
tar --use-compress-program=unzstd -tf omarchy.db.tar.zst | grep -q "^$p-[^-]*-[^-]*/$" || { echo " $p"; missing=1; }
done
du -sh .
exit $missing

- name: Upload repository artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.meta.outputs.artifact }}
path: ${{ env.REPO_DIR }}
if-no-files-found: error
retention-days: 7

- name: Upload build logs
if: always()
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ env.ARCH }}-${{ env.MIRROR }}
path: logs/
if-no-files-found: ignore
retention-days: 7
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ docker run --rm --platform linux/arm64 alpine:latest uname -m
# Should output: aarch64
```

**Note**: aarch64 builds use QEMU and slower than native x86_64 builds.
**Note**: Local aarch64 builds use QEMU and are slower than native builds.

## Quick Start

Expand Down Expand Up @@ -695,6 +695,7 @@ bin/repo release --package my-package
- Uses Arch Linux ARM repositories
- Additional repos: `[alarm]`, `[aur]`
- Same workflow, just add `--arch aarch64`
- For native CI builds, run the **aarch64 package repo** workflow.

### Building for Both Architectures

Expand Down
14 changes: 8 additions & 6 deletions bin/update-repo
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ source "$BUILD_ROOT/helpers/lock-helpers.sh"

# Function to update repository database using Docker
update_database() {
local platform_arg

print_info "Updating repository database in Docker container..."

# Check Docker is available
Expand All @@ -28,17 +30,17 @@ update_database() {
# Make output directory writable for container
make_dir_writable "$REPO_DIR"

# repo-add is architecture- and mirror-independent, so always use the edge
# x86_64 image. This also lets bootstrap-rc build the rc database before the
# rc channel exists remotely (an rc image can only build after it does).
build_docker_image "$BUILD_DIR" "x86_64" "edge"
# Match the target architecture to keep native builds native.
# Use edge so RC bootstrapping does not require an existing RC image.
build_docker_image "$BUILD_DIR" "$ARCH" "edge"
platform_arg=$(get_platform_arg "$ARCH")

docker run --rm --platform linux/amd64 \
docker run --rm $platform_arg \
-e ARCH="$ARCH" \
-e MIRROR="$MIRROR" \
-v "$REPO_ROOT:/output" \
-v "$BUILD_DIR:/build:ro" \
omarchy-pkg-builder:latest-x86_64-edge /build/update-repo.sh
"omarchy-pkg-builder:latest-${ARCH}-edge" /build/update-repo.sh
}

# Main execution
Expand Down
11 changes: 11 additions & 0 deletions pkgbuilds/tensaku/.omarchy/patches/build-for-aarch64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,7 +9,7 @@ pkgname=tensaku
pkgver=0.26.7
pkgrel=1
pkgdesc='Modern screenshot annotation tool for Wayland'
-arch=('x86_64')
+arch=('x86_64' 'aarch64')
url='https://github.com/jondkinney/tensaku'
license=('MPL-2.0')
depends=('gtk4' 'gtk4-layer-shell' 'libadwaita' 'libepoxy' 'fontconfig')
2 changes: 1 addition & 1 deletion pkgbuilds/tensaku/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pkgname=tensaku
pkgver=0.28.0
pkgrel=1
pkgdesc='Modern screenshot annotation tool for Wayland'
arch=('x86_64')
arch=('x86_64' 'aarch64')
url='https://github.com/jondkinney/tensaku'
license=('MPL-2.0')
depends=('gtk4' 'gtk4-layer-shell' 'libadwaita' 'libepoxy' 'fontconfig')
Expand Down
11 changes: 11 additions & 0 deletions pkgbuilds/tzupdate/.omarchy/patches/build-for-aarch64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@ pkgver=3.1.0
pkgrel=1
pkgdesc='Set the system timezone based on IP geolocation'
url=https://github.com/cdown/tzupdate
-arch=('x86_64')
+arch=('x86_64' 'aarch64')
options=(!lto)
license=('MIT')
makedepends=('cargo')
2 changes: 1 addition & 1 deletion pkgbuilds/tzupdate/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkgver=3.1.0
pkgrel=1
pkgdesc='Set the system timezone based on IP geolocation'
url=https://github.com/cdown/tzupdate
arch=('x86_64')
arch=('x86_64' 'aarch64')
options=(!lto)
license=('MIT')
makedepends=('cargo')
Expand Down