Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: package the plugin for lua(rocks)
### Summary This PR is part of a push to get (neo)vim plugins on [LuaRocks](https://luarocks.org/labels/neovim). * See [this blog post](https://mrcjkb.github.io/posts/2023-01-10-luarocks-tag-release.html), which follows up on [a series of posts](https://teto.github.io/posts/2021-09-17-neovim-plugin-luarocks.html) by @teto. * I'm aware this is a vimscript plugin. But that does not prevent `luarocks` from being able to package this smile In fact, as a popular plugin that many other plugins depend on, having `vim-repeat` on LuaRocks.org could be great for further adoption. * If you support this, please let me know if you would like me to add equivalent PRs to your other plugins. ### Things done: * Add a workflow that publishes tags to LuaRocks when a tag is pushed. ### Notes * Tagged releases are installed locally and then published to LuaRocks.org. On PRs, a test release is installed, but not published. * For the release workflow to work, someone with a LuaRocks.org account will have to add their [API key](https://luarocks.org/settings/api-keys) to this repo's [GitHub actions secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository). * Due to a shortcoming in LuaRocks ([label doesn't get picked up from rockspec luarocks/luarocks-site#188](luarocks/luarocks-site#188)), the `neovim` and/or `vim` labels have to be added to the LuaRocks package manually (after the first upload), for this plugin to show up in [luarocks.org/labels/neovim](https://luarocks.org/labels/neovim) or [luarocks.org/labels/vim](https://luarocks.org/labels/vim), respectively. I have tested this with the [`quick-scope`](https://github.com/unblevable/quick-scope) plugin in Neovim using the following minimal config: ``` mkdir /tmp/nvim-test luarocks install --tree /tmp/nvim-test quick-scope cd /tmp/nvim-test nvim minimal.lua # paste minimal.lua below nvim -u minimal.lua test.txt ``` ```lua -- minimal.lua -- Ignore default config local config_path = vim.fn.stdpath('config') vim.opt.rtp:remove(config_path) -- Ignore default plugins local data_path = vim.fn.stdpath('data') local pack_path = data_path .. '/site' vim.opt.packpath:remove(pack_path) vim.opt.runtimepath:append('lib/luarocks/rocks-5.1/quick-scope/scm-1/') ``` ...and it works tada ![image](https://user-images.githubusercontent.com/12857160/258669184-ea7bd712-6227-486f-ba21-d9ba44de910c.png) **Adding the API key (screen shot)** ![github-add-luarocks-api-key](https://user-images.githubusercontent.com/12857160/211071297-afb129be-7a8f-4662-b282-9d52bb0286de.png)
- Loading branch information