summaryrefslogtreecommitdiff
path: root/mise.toml
blob: 1de7ca98401b18ff8a60d53f11fa9c7b84ab0a2b (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
# Release plumbing. `mise run version <x.y.z>` rewrites the rockspec.

[tasks.check]
description = "Run the self-check inside panto's interpreter"
dir = "{{config_root}}"
run = "panto lua _selfcheck.lua"

[tasks.verify]
description = "Compare moved themes against Panto core"
dir = "{{config_root}}"
run = '''
set -eu
PANTOGRAPH_DIR="${PANTOGRAPH_DIR:-../pantograph}"
(cd "$PANTOGRAPH_DIR" && panto lua "{{config_root}}/scripts/verify-against-core.lua")
'''

[tasks.version]
description = "Rewrite the rockspec for a version (then commit it)"
dir = "{{config_root}}"
run = '''
set -eu
NEW="{{arg(name='version')}}"
SPEC="$(ls -1 ./*.rockspec)"
PKG="$(sed -n 's/^package = "\\(.*\\)"/\\1/p' "$SPEC")"
NEWSPEC="./$PKG-$NEW-1.rockspec"
TMP="$(mktemp)"
sed -e "s/^version = \\\".*\\\"/version = \\\"$NEW-1\\\"/" \\\
    -e "s/^\\( *\\)tag = \\\"v[^\\\"]*\\\"/\\1tag = \\\"v$NEW\\\"/" "$SPEC" > "$TMP"
mv "$TMP" "$NEWSPEC"
[ "$SPEC" = "$NEWSPEC" ] || rm -f "$SPEC"
luarocks lint "$NEWSPEC"
'''