summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarc Jakobi <mrcjkb89@outlook.com>2023-01-10 15:33:23 +0100
committerGitHub <noreply@github.com>2023-01-10 15:33:23 +0100
commite8c01bab917537ba4f54193c29b77bf4a04584d3 (patch)
tree36a7689c727ffb304ad14a4d60e8cc469de9e346 /scripts
parent04af51dbfb17c2afa0b8d82b0e842e0638201ca9 (diff)
feat: add rockspec + luarocks upload workflow (#2276)
telescope.nvim is a common dependency across Neovim plugins. Using luarocks may alleviate the need for users to specify their plugins' dependencies in their plugin manager. (e.g., vim-plug or packer). See also: https://teto.github.io/posts/2021-09-17-neovim-plugin-luarocks.html
Diffstat (limited to 'scripts')
-rw-r--r--scripts/luarocks-upload.sh10
-rw-r--r--scripts/test-luarocks-install.sh4
2 files changed, 14 insertions, 0 deletions
diff --git a/scripts/luarocks-upload.sh b/scripts/luarocks-upload.sh
new file mode 100644
index 0000000..8807d9e
--- /dev/null
+++ b/scripts/luarocks-upload.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Expects the LUAROCKS_API_KEY secret to be set
+
+TMP_DIR=$(mktemp -d)
+MODREV=$(git describe --tags --always --first-parent | tr -d "v")
+DEST_ROCKSPEC="$TMP_DIR/telescope.nvim-$MODREV-1.rockspec"
+cp "telescope.nvim-scm-1.rockspec" "$DEST_ROCKSPEC"
+sed -i "s/= 'scm'/= '$MODREV'/g" "$DEST_ROCKSPEC"
+luarocks upload "$DEST_ROCKSPEC" --api-key="$LUAROCKS_API_KEY"
diff --git a/scripts/test-luarocks-install.sh b/scripts/test-luarocks-install.sh
new file mode 100644
index 0000000..8198015
--- /dev/null
+++ b/scripts/test-luarocks-install.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+MODREV=$(git describe --tags --always --first-parent | tr -d "v")
+luarocks install "telescope.nvim" "$MODREV"