diff --git a/.github/workflows/luarocks.yml b/.github/workflows/luarocks.yml new file mode 100644 index 00000000..0e5c2ff1 --- /dev/null +++ b/.github/workflows/luarocks.yml @@ -0,0 +1,21 @@ +--- +"on": + push: + paths-ignore: + - "**.md" + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: nvim-neorocks/luarocks-tag-release@v5 + env: + LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}} + if: "! startsWith(github.ref, 'refs/tags/')" + with: + extra_luarocks_args: | + --force + version: scm + template: template.rockspec diff --git a/template.rockspec b/template.rockspec new file mode 100644 index 00000000..2ecbe674 --- /dev/null +++ b/template.rockspec @@ -0,0 +1,42 @@ +local git_ref = '$git_ref' +local modrev = '$modrev' +local specrev = '$specrev' + +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 = $dependencies + +test_dependencies = $test_dependencies + +source = { + url = repo_url .. '/archive/' .. git_ref .. '.zip', + dir = '$repo_name-' .. '$archive_dir_suffix', +} + +if modrev == 'scm' or modrev == 'dev' then + source = { + url = repo_url:gsub('https', 'git') + } +end + +build = { + type = 'builtin', + copy_directories = $copy_directories, + install = { + conf = { + ['..'] = 'package.json' + } + } +}