Skip to content

Commit 2673f0e

Browse files
committed
feat: add luarocks support
1 parent a479d1c commit 2673f0e

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed

.github/workflows/luarocks.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Push to Luarocks
2+
3+
on:
4+
push:
5+
release:
6+
types:
7+
- created
8+
tags:
9+
- '*'
10+
workflow_dispatch:
11+
12+
jobs:
13+
luarocks-upload:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0 # Required to count the commits
19+
- name: Get Version
20+
run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
21+
- name: Install C/C++ Compiler
22+
uses: rlalik/setup-cpp-compiler@master
23+
with:
24+
compiler: clang-latest
25+
- name: Install Lua
26+
uses: leso-kn/gh-actions-lua@master
27+
with:
28+
luaVersion: "5.1"
29+
- name: Install Luarocks
30+
uses: hishamhm/gh-actions-luarocks@master
31+
- name: Install `luarocks-build-treesitter-parser` Package
32+
run: |
33+
luarocks --verbose --local --lua-version=5.1 install luarocks-build-treesitter-parser
34+
- name: LuaRocks Upload
35+
uses: nvim-neorocks/luarocks-tag-release@v5
36+
env:
37+
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
38+
with:
39+
name: tree-sitter-norg-meta
40+
version: ${{ env.LUAROCKS_VERSION }}
41+
labels: |
42+
neovim
43+
tree-sitter
44+
summary: Treesitter parser for Norg's `@document.meta` blocks.
45+
template: .github/workflows/tree-sitter-norg-meta.rockspec.template
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release Please Automatic Semver
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: google-github-actions/release-please-action@v3
14+
with:
15+
release-type: rust
16+
package-name: tree-sitter-norg-meta
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
local git_ref = '$git_ref'
2+
local modrev = '$modrev'
3+
local specrev = '$specrev'
4+
5+
local repo_url = '$repo_url'
6+
7+
rockspec_format = '3.0'
8+
package = '$package'
9+
version = modrev ..'-'.. specrev
10+
11+
description = {
12+
summary = '$summary',
13+
labels = $labels,
14+
homepage = '$homepage',
15+
$license
16+
}
17+
18+
build_dependencies = {
19+
'luarocks-build-treesitter-parser >= 1.3.0',
20+
}
21+
22+
source = {
23+
url = repo_url .. '/archive/' .. git_ref .. '.zip',
24+
dir = '$repo_name-' .. '$archive_dir_suffix',
25+
}
26+
27+
build = {
28+
type = "treesitter-parser",
29+
lang = "norg_meta",
30+
sources = { "src/parser.c" },
31+
}

0 commit comments

Comments
 (0)