[tasks.check] description = "Offline Antigravity provider acceptance check (macOS, fake account and CLI)" dir = "{{config_root}}" run = ''' set -eu bin="${PANTO:-$(command -v panto)}" luarocks lint ./*.rockspec "$bin" lua _quota_selfcheck.lua "$bin" lua check.lua PANTO_CHECK_ROCK=1 "$bin" lua check.lua ''' [tasks.version] description = "Prepare a versioned rockspec for commit" dir = "{{config_root}}" usage = 'arg ""' run = ''' set -eu ver="$usage_version" printf '%s\n' "$ver" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' || { echo 'expected x.y.z' >&2; exit 1; } set -- ./*.rockspec [ "$#" -eq 1 ] && [ -f "$1" ] || { echo 'expected one rockspec' >&2; exit 1; } new="./panto-antigravity-$ver-1.rockspec" [ "$new" != "$1" ] || exit 0 sed -e "s/^version = .*/version = \"$ver-1\"/" -e "s/^ tag = .*/ tag = \"v$ver\",/" "$1" > "$new" luarocks lint "$new" rm "$1" ''' [tasks.release] description = "Tag the committed release, push its tag and upload to LuaRocks" dir = "{{config_root}}" depends = ["check"] run = ''' set -eu set -- ./panto-antigravity-*.rockspec version=${1#./panto-antigravity-} tag=v${version%-1.rockspec} rev=${REV:-@-} jj file show -r "$rev" "$1" | cmp - "$1" || { echo 'commit the rockspec first' >&2; exit 1; } remotes=$(jj git remote list | awk '{print $1}') [ -n "$remotes" ] || { echo 'configure the public source remote first' >&2; exit 1; } [ -z "$(jj tag list "$tag")" ] || { echo "$tag already exists" >&2; exit 1; } jj tag set "$tag" -r "$rev" for remote in $remotes; do jj git push --remote "$remote" --tag "$tag"; done luarocks upload "$1" '''