chore: use luarocks-tag-release action for luarocks upload (#458)

* chore: use luarocks-tag-release action for luarocks upload

* docs(readme): add luarocks badge
This commit is contained in:
Marc Jakobi 2023-02-19 10:01:26 +01:00 committed by GitHub
parent 706bd3f571
commit d430deda18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 39 deletions

View file

@ -8,15 +8,14 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: leafo/gh-actions-lua@v9
with:
luaVersion: "luajit-2.1.0-beta3"
- uses: leafo/gh-actions-luarocks@v4
- name: Install dkjson
run: luarocks install dkjson
- name: Luarocks Upload
env:
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v1.0.2
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
run: make luarocks_upload
- name: Install release
run: make test_luarocks_install
with:
summary: "lua functions you don't want to write"
detailed_description: |
plenary: full; complete; entire; absolute; unqualified.
All the lua functions I don't want to write twice.
template: "./rockspec.template"

View file

@ -7,9 +7,3 @@ generate_filetypes:
lint:
luacheck lua/plenary
luarocks_upload:
bash ./scripts/luarocks-upload.sh
test_luarocks_install:
bash ./scripts/test-luarocks-install.sh

View file

@ -12,6 +12,8 @@ At the moment, it is very much in pre-alpha :smile: Expect changes to the way so
## Installation
[![LuaRocks](https://img.shields.io/luarocks/v/Conni2461/plenary.nvim?logo=lua&color=purple)](https://luarocks.org/modules/Conni2461/plenary.nvim)
Using [plug](https://github.com/junegunn/vim-plug):
```vim

View file

@ -19,16 +19,9 @@ dependencies = {
}
source = {
url = 'http://github.com/nvim-lua/plenary.nvim/archive/v' .. _MODREV .. '.zip',
dir = 'plenary.nvim-' .. _MODREV,
url = 'git://github.com/nvim-lua/plenary.nvim',
}
if _MODREV == 'scm' then
source = {
url = 'git://github.com/nvim-lua/plenary.nvim',
}
end
build = {
type = 'builtin',
copy_directories = {

40
rockspec.template Normal file
View file

@ -0,0 +1,40 @@
local git_tag = '$git_tag'
local modrev = '$modrev'
local specrev = '-1'
local repo_url = '$repo_url'
rockspec_format = '3.0'
package = '$package'
version = modrev .. specrev
description = {
summary = '$summary',
detailed = $detailed_description,
labels = $labels,
homepage = '$homepage',
$license
}
dependencies = {
'lua >= 5.1, < 5.4',
'luassert'
}
source = {
url = repo_url .. '/archive/' .. git_tag .. '.zip',
dir = '$repo_name-' .. modrev,
}
build = {
type = 'builtin',
copy_directories = {
'data',
'plugin'
}
}
test = {
type = 'command',
command = 'make test'
}

View file

@ -1,10 +0,0 @@
#!/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/plenary.nvim-$MODREV-1.rockspec"
cp "plenary.nvim-scm-1.rockspec" "$DEST_ROCKSPEC"
sed -i "s/= 'scm',/= '$MODREV',/g" "$DEST_ROCKSPEC"
luarocks upload "$DEST_ROCKSPEC" --api-key="$LUAROCKS_API_KEY"

View file

@ -1,4 +0,0 @@
#!/usr/bin/env bash
MODREV=$(git describe --tags --always --first-parent | tr -d "v")
luarocks install "plenary.nvim" "$MODREV"