From 2df0fbdadd947cd2995566a0117b8802a9ba74f4 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Fri, 6 Jan 2023 23:58:19 +0100 Subject: ci: add luarocks upload release workflow The recently added rockspec (see #2307) has to be prepared and uploaded to luarocks for each release. This adds an automated workflow for it, which has been tested with plenary.nvim. To be able to upload to luarocks, the owner of the luarocks account will have to add an API key named `LUAROCKS_API_KEY` to this repo's GitHub Actions secrets. --- scripts/luarocks-upload.sh | 10 ++++++++++ scripts/test-luarocks-install.sh | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 scripts/luarocks-upload.sh create mode 100644 scripts/test-luarocks-install.sh (limited to 'scripts') diff --git a/scripts/luarocks-upload.sh b/scripts/luarocks-upload.sh new file mode 100644 index 00000000..8c4ff1f4 --- /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/nvim-lspconfig-$MODREV-1.rockspec" +cp "nvim-lspconfig-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 00000000..8d8d3242 --- /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 "nvim-lspconfig" "$MODREV" -- cgit v1.2.3-70-g09d2