diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1e00ec2 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +--- +"on": + push: + paths-ignore: + - "**.md" + - doc/* + pull_request: + paths-ignore: + - "**.md" + - doc/* + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get -y update + sudo apt-get -y install libgit2-dev + - uses: lumen-oss/luarocks-tag-release@v7 + env: + LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}} + if: "! startsWith(github.ref, 'refs/tags/')" + with: + extra_luarocks_args: | + --force + version: scm + template: template.rockspec + - uses: lumen-oss/luarocks-tag-release@v7 + env: + LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}} + if: startsWith(github.ref, 'refs/tags/') + with: + extra_luarocks_args: | + --force + template: template.rockspec diff --git a/rockspecs/lua-git2-0.1-1.rockspec b/rockspecs/lua-git2-0.1-1.rockspec deleted file mode 100755 index 6319be5..0000000 --- a/rockspecs/lua-git2-0.1-1.rockspec +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env lua - -package = 'lua-git2' -version = '0.1-1' -source = { - url = 'git://github.com/libgit2/luagit2.git', - branch = "v0.1" -} -description = { - summary = "LibGit2 bindings for Lua.", - detailed = '', - homepage = 'https://github.com/libgit2/luagit2', - license = 'MIT', - maintainer = "Robert G. Jakabosky", -} -dependencies = { - 'lua >= 5.1, < 5.5', -} -external_dependencies = { - GIT2 = { - header = "git2.h", - library = "git2", - } -} -build = { - type = "builtin", - modules = { - git2 = { - sources = { "src/pre_generated-git2.nobj.c" }, - libraries = { "git2" }, - incdirs = { "$(GIT2_INCDIR)" }, - libdirs = { "$(GIT2_LIBDIR)" }, - } - } -} diff --git a/rockspecs/lua-git2-scm-0.rockspec b/rockspecs/lua-git2-scm-0.rockspec deleted file mode 100755 index 2c0a2e0..0000000 --- a/rockspecs/lua-git2-scm-0.rockspec +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env lua - -package = 'lua-git2' -version = 'scm-0' -source = { - url = 'git://github.com/libgit2/luagit2.git' -} -description = { - summary = "LibGit2 bindings for Lua.", - detailed = '', - homepage = 'https://github.com/libgit2/luagit2', - license = 'MIT', - maintainer = "Robert G. Jakabosky", -} -dependencies = { - 'lua >= 5.1, < 5.5', -} -external_dependencies = { - GIT2 = { - header = "git2.h", - library = "git2", - } -} -build = { - type = "builtin", - modules = { - git2 = { - sources = { "src/pre_generated-git2.nobj.c" }, - libraries = { "git2" }, - incdirs = { "$(GIT2_INCDIR)" }, - libdirs = { "$(GIT2_LIBDIR)" }, - } - } -} diff --git a/template.rockspec b/template.rockspec new file mode 100644 index 0000000..342452b --- /dev/null +++ b/template.rockspec @@ -0,0 +1,50 @@ +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 + +external_dependencies = { + GIT2 = { + header = "git2.h", + library = "git2", + } +} +build = { + type = "builtin", + modules = { + git2 = { + sources = { "src/pre_generated-git2.nobj.c" }, + libraries = { "git2" }, + incdirs = { "$(GIT2_INCDIR)" }, + libdirs = { "$(GIT2_LIBDIR)" }, + } + } +}