blob: 8e037c3855c01533d5d7ee5b1df18f6c28449e85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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 ./*.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"
'''
|