summaryrefslogtreecommitdiff
path: root/mise.toml
diff options
context:
space:
mode:
Diffstat (limited to 'mise.toml')
-rw-r--r--mise.toml39
1 files changed, 38 insertions, 1 deletions
diff --git a/mise.toml b/mise.toml
index 376a6fe..8e037c3 100644
--- a/mise.toml
+++ b/mise.toml
@@ -1,10 +1,47 @@
[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 panto-antigravity-scm-1.rockspec
+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 "<version>"'
+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"
+'''