Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publish releases to luarocks #185

Merged
merged 7 commits into from
Mar 25, 2023
Merged

Conversation

mrcjkb
Copy link
Contributor

@mrcjkb mrcjkb commented Dec 15, 2022

neotest 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

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Dec 15, 2022

If this PR is accepted, a package on www.luarocks.org will need to be added, which can be done from only one account. See luarocks/luarocks-site#173.

@rcarriga
Copy link
Collaborator

Very cool thanks for the PR! One question on the copied directories, do you know if this is this handled by packer by adding them to the RTP? I'd be worried that if a user installs it from luarocks, they wouldn't see the docs

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Dec 18, 2022

Very cool thanks for the PR! One question on the copied directories, do you know if this is this handled by packer by adding them to the RTP? I'd be worried that if a user installs it from luarocks, they wouldn't see the docs

Good question.
Packer uses hererocks under the hood, and there's an open issue to change that.
This blog post seems to suggest that packer does (or will?) copy directories in the copy_directories directive to the installation root.

@rcarriga
Copy link
Collaborator

OK just wanted to check thank you. One thing, I've tried adding nvim-treesitter as a dependency but it fails with Error fetching file: Failed downloading http://github.com/nvim-treesitter/nvim-treesitter/archive/vscm.zip - failed downloading http://github.com/nvim-treesitter/nvim-treesitter/archive/vscm.zip, is that an issue specific to nvim-treesitter? Is that supposed to resolve to something? The corresponding URL in the rockspec in this PR doesn't resolve to anything either

@rcarriga
Copy link
Collaborator

It also seems the version of plenary that is available is outdated (missing the filetype module) and so isn't compatible. It seems like the scm version is a manually uploaded version, not an automatic zip of the latest code as I had first assumed. I think for a proper implementation, I'll need to alter the existing release workflow to push a luarock release. We'll also need the other libraries to do the same before this can be used by users

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Dec 19, 2022

Yup. I'm facing similar issues with one of my repos that I'm trying to make compatible with luarocks. Let's mark this as draft for now, and I'll get back to it when I know more and have a solution.

@mrcjkb mrcjkb marked this pull request as draft December 19, 2022 18:21
@teto
Copy link

teto commented Dec 22, 2022

It seems like the the scm version is a manually uploaded version,

The scm version installs the one from the "source control manager", git usually. So it should install the latest version. Problem is you have to tell luarocks to install dev/"scm" versions otherwise it doesn't see them.
Looks like there are issues with the nvim-treesitter rockspec (and the git tags appeared after the rockspec, starting with neovim 0.8). I've tried to fix the issues to upload a stable rockspec to luarocks:
https://github.com/teto/nvim-treesitter/pull/new/release-rockspec-0.8.1

but I still have an issue: with the "builtin" build type of luarocks, luarocks tries to compile the test files of nvim-treesitter and some of them are broken on purpose which makes the install so I am not sure which way to go to work around that (changing the build type removes the 'builtin' install which helps skip lots of boilerplate). I will ask on luarocks. Thanks for the PR.

@teto
Copy link

teto commented Dec 26, 2022

so I've gone the Makefile way and have a working build at https://github.com/teto/nvim-treesitter/tree/release-rockspec-0.8.1. Will try to merge this in nvim-treesitter/test it in nixpkgs

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Jan 6, 2023

@rcarriga plenary.nvim now has an automated release workflow 🥳

nvim-lua/plenary.nvim#439

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Jan 6, 2023

so I've gone the Makefile way and have a working build at https://github.com/teto/nvim-treesitter/tree/release-rockspec-0.8.1. Will try to merge this in nvim-treesitter/test it in nixpkgs

@teto I'll merge your makefile approach with the automated release workflow and open a draft PR to nvim-treesitter.

[Edit] the Makefile looks like you're still experimenting with it?

@rcarriga
Copy link
Collaborator

rcarriga commented Jan 8, 2023

Awesome to hear! I'll try get some time to integrate an automated release with the semantic release neotest already has. I'd love to have versioned releases 😁

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Feb 3, 2023

I have just published a GitHub action to simplify LuaRocks releases.

neotest 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
@mrcjkb
Copy link
Contributor Author

mrcjkb commented Mar 11, 2023

I have updated this PR with a workflow that automatically publishes to LuaRocks whenever a release is published, along with a LuaRocks badge in the readme (assuming the existence of a nvim-neotest/neotest package).

Notes

Adding the API key (screen shot)
github-add-luarocks-api-key

@mrcjkb mrcjkb marked this pull request as ready for review March 12, 2023 18:28
@mrcjkb mrcjkb changed the title feat: add rockspec feat: publish releases to luarocks Mar 21, 2023
@rcarriga
Copy link
Collaborator

Hey apologies for not looking at this recently, but thanks for keeping it maintained and improving it! I love having it all handled by the action 😁

@rcarriga rcarriga merged commit 9f35041 into nvim-neotest:master Mar 25, 2023
@rcarriga
Copy link
Collaborator

Hmm it doesn't seem to have triggered, any idea why?

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Mar 25, 2023

Hmm it doesn't seem to have triggered, any idea why?

That's strange. I've been having a similar issue in which my release workflow doesn't publish the action to the marketplace (it just creates a github release).

Maybe the published trigger isn't the right one for this workflow. I'll debug it in my fork and open another PR with a fix.

@mrcjkb mrcjkb deleted the rockspec branch March 25, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants