Skip to content

Commit

Permalink
ci: publish to luarocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Sep 23, 2024
1 parent bb70728 commit 3edc0fa
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/luarocks.yml
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions template.rockspec
Original file line number Diff line number Diff line change
@@ -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'
}
}
}

0 comments on commit 3edc0fa

Please sign in to comment.