Skip to content

Commit

Permalink
Merge pull request #1 from mrcjkb/main
Browse files Browse the repository at this point in the history
feat: rocks.nvim/luarocks support
  • Loading branch information
kristijanhusak authored Apr 5, 2024
2 parents f8c6b1e + f608f4b commit 911fe2d
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/luarocks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Push to Luarocks

on:
push:
tags:
- '*'
release:
types:
- created
pull_request: # Runs test install on PR without uploading
workflow_dispatch: # Allows to trigger manually

jobs:
luarocks-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to count the commits
- name: Get Version
run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: Install C/C++ Compiler
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang-latest
- name: Install Lua
uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- name: Install Luarocks
uses: hishamhm/gh-actions-luarocks@master
- name: Install `luarocks-build-treesitter-parser` Package
run: |
luarocks --verbose --local --lua-version=5.1 install luarocks-build-treesitter-parser
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v5
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
name: tree-sitter-orgmode
version: ${{ env.LUAROCKS_VERSION }}
labels: |
neovim
tree-sitter
summary: A fork of tree-sitter-org, for use with the orgmode Neovim plugin
template: .github/workflows/tree-sitter-orgmode.rockspec.template
32 changes: 32 additions & 0 deletions .github/workflows/tree-sitter-orgmode.rockspec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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',
labels = $labels,
homepage = '$homepage',
$license
}

build_dependencies = {
'luarocks-build-treesitter-parser >= 1.3.0',
}

source = {
url = repo_url .. '/archive/' .. git_ref .. '.zip',
dir = '$repo_name-' .. '$archive_dir_suffix',
}

build = {
type = "treesitter-parser",
lang = "org",
sources = { "src/parser.c", "src/scanner.c" },
copy_directories = { "queries" },
}

0 comments on commit 911fe2d

Please sign in to comment.