- Add show-versions, crate-version for version inspection - Add bump-crate, bump-plugins for individual/batch version bumps - Add aur-update-pkg, aur-publish-pkg for per-package AUR management - Add aur-update-plugins, aur-publish-plugins for batch operations - Add aur-status to show all AUR packages with versions Supports independent versioning: core at 0.3.x, plugins at 0.1.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
381 lines
10 KiB
Makefile
381 lines
10 KiB
Makefile
# Owlry build and release automation
|
|
|
|
# Default recipe
|
|
default:
|
|
@just --list
|
|
|
|
# Build debug (all workspace members)
|
|
build:
|
|
cargo build --workspace
|
|
|
|
# Build core binary only
|
|
build-core:
|
|
cargo build -p owlry
|
|
|
|
# Build release
|
|
release:
|
|
cargo build --workspace --release
|
|
|
|
# Run in debug mode
|
|
run *ARGS:
|
|
cargo run -p owlry -- {{ARGS}}
|
|
|
|
# Run tests
|
|
test:
|
|
cargo test --workspace
|
|
|
|
# Check code
|
|
check:
|
|
cargo check --workspace
|
|
cargo clippy --workspace
|
|
|
|
# Format code
|
|
fmt:
|
|
cargo fmt --all
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
cargo clean
|
|
|
|
# Build a specific plugin (when plugins exist)
|
|
plugin name:
|
|
cargo build -p owlry-plugin-{{name}} --release
|
|
|
|
# Build all plugins
|
|
plugins:
|
|
cargo build --workspace --release --exclude owlry
|
|
|
|
# Install locally (core + plugins + runtimes)
|
|
install-local:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
echo "Building release..."
|
|
# Build core without embedded Lua (smaller binary)
|
|
cargo build -p owlry --release --no-default-features
|
|
# Build plugins
|
|
cargo build --workspace --release --exclude owlry
|
|
|
|
echo "Creating directories..."
|
|
sudo mkdir -p /usr/lib/owlry/plugins
|
|
sudo mkdir -p /usr/lib/owlry/runtimes
|
|
|
|
echo "Installing core binary..."
|
|
sudo install -Dm755 target/release/owlry /usr/bin/owlry
|
|
|
|
echo "Installing plugins..."
|
|
for plugin in target/release/libowlry_plugin_*.so; do
|
|
if [ -f "$plugin" ]; then
|
|
name=$(basename "$plugin")
|
|
sudo install -Dm755 "$plugin" "/usr/lib/owlry/plugins/$name"
|
|
echo " → $name"
|
|
fi
|
|
done
|
|
|
|
echo "Installing runtimes..."
|
|
if [ -f "target/release/libowlry_lua.so" ]; then
|
|
sudo install -Dm755 target/release/libowlry_lua.so /usr/lib/owlry/runtimes/liblua.so
|
|
echo " → liblua.so"
|
|
fi
|
|
if [ -f "target/release/libowlry_rune.so" ]; then
|
|
sudo install -Dm755 target/release/libowlry_rune.so /usr/lib/owlry/runtimes/librune.so
|
|
echo " → librune.so"
|
|
fi
|
|
|
|
echo ""
|
|
echo "Installation complete!"
|
|
echo " - /usr/bin/owlry"
|
|
echo " - $(ls /usr/lib/owlry/plugins/*.so 2>/dev/null | wc -l) plugins"
|
|
echo " - $(ls /usr/lib/owlry/runtimes/*.so 2>/dev/null | wc -l) runtimes"
|
|
|
|
# === Release Management ===
|
|
|
|
# AUR package directories (relative to project root)
|
|
aur_core_dir := "aur/owlry"
|
|
|
|
# Get current version from Cargo.toml
|
|
version := `grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/'`
|
|
|
|
# Show current version
|
|
show-version:
|
|
@echo "Current version: {{version}}"
|
|
|
|
# Show all crate versions
|
|
show-versions:
|
|
#!/usr/bin/env bash
|
|
echo "=== Crate Versions ==="
|
|
for toml in Cargo.toml crates/*/Cargo.toml; do
|
|
name=$(grep '^name' "$toml" | head -1 | sed 's/.*"\(.*\)"/\1/')
|
|
ver=$(grep '^version' "$toml" | head -1 | sed 's/.*"\(.*\)"/\1/')
|
|
printf " %-30s %s\n" "$name" "$ver"
|
|
done
|
|
|
|
# Get version of a specific crate
|
|
crate-version crate:
|
|
@grep '^version' crates/{{crate}}/Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/'
|
|
|
|
# Bump a specific crate version (usage: just bump-crate owlry-plugin-calculator 0.2.0)
|
|
bump-crate crate new_version:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
toml="crates/{{crate}}/Cargo.toml"
|
|
if [ ! -f "$toml" ]; then
|
|
echo "Error: $toml not found"
|
|
exit 1
|
|
fi
|
|
old=$(grep '^version' "$toml" | head -1 | sed 's/.*"\(.*\)"/\1/')
|
|
if [ "$old" = "{{new_version}}" ]; then
|
|
echo "{{crate}} is already at {{new_version}}, skipping"
|
|
exit 0
|
|
fi
|
|
echo "Bumping {{crate}} from $old to {{new_version}}"
|
|
sed -i 's/^version = ".*"/version = "{{new_version}}"/' "$toml"
|
|
cargo check -p {{crate}}
|
|
git add "$toml" Cargo.lock
|
|
git commit -m "chore({{crate}}): bump version to {{new_version}}"
|
|
echo "{{crate}} bumped to {{new_version}}"
|
|
|
|
# Bump all plugins to same version (usage: just bump-plugins 0.2.0)
|
|
bump-plugins new_version:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
for toml in crates/owlry-plugin-*/Cargo.toml; do
|
|
crate=$(basename $(dirname "$toml"))
|
|
old=$(grep '^version' "$toml" | head -1 | sed 's/.*"\(.*\)"/\1/')
|
|
if [ "$old" != "{{new_version}}" ]; then
|
|
echo "Bumping $crate from $old to {{new_version}}"
|
|
sed -i 's/^version = ".*"/version = "{{new_version}}"/' "$toml"
|
|
fi
|
|
done
|
|
cargo check --workspace
|
|
git add crates/owlry-plugin-*/Cargo.toml Cargo.lock
|
|
git commit -m "chore(plugins): bump all plugins to {{new_version}}"
|
|
echo "All plugins bumped to {{new_version}}"
|
|
|
|
# Bump version (usage: just bump 0.2.0)
|
|
bump new_version:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
if [ "{{version}}" = "{{new_version}}" ]; then
|
|
echo "Version is already {{new_version}}, skipping bump"
|
|
exit 0
|
|
fi
|
|
echo "Bumping version from {{version}} to {{new_version}}"
|
|
sed -i 's/^version = ".*"/version = "{{new_version}}"/' Cargo.toml
|
|
cargo check
|
|
git add Cargo.toml Cargo.lock
|
|
git commit -m "chore: bump version to {{new_version}}"
|
|
echo "Version bumped to {{new_version}}"
|
|
|
|
# Create and push a release tag
|
|
tag:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
if git rev-parse "v{{version}}" >/dev/null 2>&1; then
|
|
echo "Tag v{{version}} already exists, skipping"
|
|
exit 0
|
|
fi
|
|
echo "Creating tag v{{version}}"
|
|
git tag -a "v{{version}}" -m "Release v{{version}}"
|
|
git push origin "v{{version}}"
|
|
echo "Tag v{{version}} pushed"
|
|
|
|
# Update AUR package (core)
|
|
aur-update:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "{{aur_core_dir}}"
|
|
|
|
url="https://somegit.dev/Owlibou/owlry"
|
|
|
|
echo "Updating PKGBUILD to version {{version}}"
|
|
sed -i 's/^pkgver=.*/pkgver={{version}}/' PKGBUILD
|
|
sed -i 's/^pkgrel=.*/pkgrel=1/' PKGBUILD
|
|
|
|
# Update checksums (b2sums)
|
|
echo "Updating checksums..."
|
|
b2sum=$(curl -sL "$url/archive/v{{version}}.tar.gz" | b2sum | cut -d' ' -f1)
|
|
sed -i "s/^b2sums=.*/b2sums=('$b2sum')/" PKGBUILD
|
|
|
|
# Generate .SRCINFO
|
|
echo "Generating .SRCINFO..."
|
|
makepkg --printsrcinfo > .SRCINFO
|
|
|
|
# Show diff
|
|
git diff
|
|
|
|
echo ""
|
|
echo "AUR package updated. Review changes above."
|
|
echo "Run 'just aur-publish' to commit and push."
|
|
|
|
# Publish AUR package (core)
|
|
aur-publish:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "{{aur_core_dir}}"
|
|
|
|
git add PKGBUILD .SRCINFO
|
|
git commit -m "Update to v{{version}}"
|
|
git push
|
|
|
|
echo "AUR package v{{version}} published!"
|
|
|
|
# Test AUR package build locally (core)
|
|
aur-test:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "{{aur_core_dir}}"
|
|
|
|
echo "Testing PKGBUILD..."
|
|
makepkg -sf
|
|
|
|
echo ""
|
|
echo "Package built successfully!"
|
|
ls -lh *.pkg.tar.zst
|
|
|
|
# === AUR Package Management (individual packages) ===
|
|
|
|
# Update a specific AUR package (usage: just aur-update-pkg owlry-plugin-calculator)
|
|
aur-update-pkg pkg:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
aur_dir="aur/{{pkg}}"
|
|
|
|
if [ ! -d "$aur_dir" ]; then
|
|
echo "Error: $aur_dir not found"
|
|
exit 1
|
|
fi
|
|
|
|
# Determine crate name (strip owlry- prefix for meta-packages)
|
|
case "{{pkg}}" in
|
|
owlry-essentials|owlry-tools|owlry-widgets|owlry-full)
|
|
# Meta-packages have no crate, use PKGBUILD version
|
|
crate_ver=$(grep '^pkgver=' "$aur_dir/PKGBUILD" | sed 's/pkgver=//')
|
|
;;
|
|
*)
|
|
# Get version from crate
|
|
crate_dir="crates/{{pkg}}"
|
|
if [ ! -d "$crate_dir" ]; then
|
|
echo "Error: $crate_dir not found"
|
|
exit 1
|
|
fi
|
|
crate_ver=$(grep '^version' "$crate_dir/Cargo.toml" | head -1 | sed 's/.*"\(.*\)"/\1/')
|
|
;;
|
|
esac
|
|
|
|
cd "$aur_dir"
|
|
url="https://somegit.dev/Owlibou/owlry"
|
|
|
|
echo "Updating {{pkg}} PKGBUILD to version $crate_ver"
|
|
sed -i "s/^pkgver=.*/pkgver=$crate_ver/" PKGBUILD
|
|
sed -i 's/^pkgrel=.*/pkgrel=1/' PKGBUILD
|
|
|
|
# Update checksums for packages that download source
|
|
if grep -q "^source=" PKGBUILD; then
|
|
echo "Updating checksums..."
|
|
b2sum=$(curl -sL "$url/archive/v$crate_ver.tar.gz" | b2sum | cut -d' ' -f1)
|
|
sed -i "s/^b2sums=.*/b2sums=('$b2sum')/" PKGBUILD
|
|
fi
|
|
|
|
# Generate .SRCINFO
|
|
echo "Generating .SRCINFO..."
|
|
makepkg --printsrcinfo > .SRCINFO
|
|
|
|
git diff
|
|
echo ""
|
|
echo "{{pkg}} updated to $crate_ver. Run 'just aur-publish-pkg {{pkg}}' to publish."
|
|
|
|
# Publish a specific AUR package
|
|
aur-publish-pkg pkg:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
aur_dir="aur/{{pkg}}"
|
|
|
|
if [ ! -d "$aur_dir" ]; then
|
|
echo "Error: $aur_dir not found"
|
|
exit 1
|
|
fi
|
|
|
|
cd "$aur_dir"
|
|
ver=$(grep '^pkgver=' PKGBUILD | sed 's/pkgver=//')
|
|
|
|
git add PKGBUILD .SRCINFO
|
|
git commit -m "Update to v$ver"
|
|
git push origin master
|
|
|
|
echo "{{pkg}} v$ver published!"
|
|
|
|
# Test a specific AUR package build locally
|
|
aur-test-pkg pkg:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "aur/{{pkg}}"
|
|
|
|
echo "Testing {{pkg}} PKGBUILD..."
|
|
makepkg -sf
|
|
|
|
echo ""
|
|
echo "Package built successfully!"
|
|
ls -lh *.pkg.tar.zst
|
|
|
|
# Update all plugin AUR packages
|
|
aur-update-plugins:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
for dir in aur/owlry-plugin-*/; do
|
|
pkg=$(basename "$dir")
|
|
echo "=== Updating $pkg ==="
|
|
just aur-update-pkg "$pkg"
|
|
echo ""
|
|
done
|
|
|
|
# Publish all plugin AUR packages
|
|
aur-publish-plugins:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
for dir in aur/owlry-plugin-*/; do
|
|
pkg=$(basename "$dir")
|
|
echo "=== Publishing $pkg ==="
|
|
just aur-publish-pkg "$pkg"
|
|
echo ""
|
|
done
|
|
|
|
# List all AUR packages with their versions
|
|
aur-status:
|
|
#!/usr/bin/env bash
|
|
echo "=== AUR Package Status ==="
|
|
for dir in aur/*/; do
|
|
pkg=$(basename "$dir")
|
|
if [ -f "$dir/PKGBUILD" ]; then
|
|
ver=$(grep '^pkgver=' "$dir/PKGBUILD" | sed 's/pkgver=//')
|
|
if [ -d "$dir/.git" ]; then
|
|
status="✓"
|
|
else
|
|
status="✗ (not initialized)"
|
|
fi
|
|
printf " %s %-30s %s\n" "$status" "$pkg" "$ver"
|
|
fi
|
|
done
|
|
|
|
# Full release workflow (bump + tag + aur)
|
|
release-full new_version: (bump new_version)
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Push version bump
|
|
git push
|
|
|
|
# Create and push tag
|
|
just tag
|
|
|
|
# Wait for tag to be available
|
|
echo "Waiting for tag to propagate..."
|
|
sleep 2
|
|
|
|
# Update AUR
|
|
just aur-update
|
|
|
|
echo ""
|
|
echo "Release v{{new_version}} prepared!"
|
|
echo "Review AUR changes, then run 'just aur-publish'"
|