#!/usr/bin/env bash # shellcheck source=./common.lib.sh source "$(dirname "$0")"/common.lib.sh function aur-publish() { local crate_name version crate_name=$(crate-name) version=$(crate-version) # Get the arch repo if [[ ! -d /tmp/"$crate_name"-bin ]]; then git -c init.defaultBranch=master clone ssh://aur@aur.archlinux.org/"$crate_name"-bin.git /tmp/"$crate_name"-bin fi # Cleanup our target directory rm -rf target/cargo-aur # build the crate properly cargo aur # Check that it compiles and create .SRCINFO cd target/cargo-aur && makepkg -f && namcap ./*.tar.zst && makepkg --printsrcinfo >.SRCINFO cd - || exit # Copy the files to the aur repo cp target/cargo-aur/{PKGBUILD,.SRCINFO} /tmp/"$crate_name"-bin # Commit the stuff git -C /tmp/"$crate_name"-bin add PKGBUILD .SRCINFO git -C /tmp/"$crate_name"-bin commit -m "Update to $version" git -C /tmp/"$crate_name"-bin push }