Skip to content

Commit

Permalink
ref: example using mlua
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas committed Oct 12, 2024
1 parent 2f1b85b commit b9a195b
Show file tree
Hide file tree
Showing 29 changed files with 687 additions and 991 deletions.
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
31 changes: 31 additions & 0 deletions .github/workflows/luarocks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

name: Push to Luarocks

on:
push:
tags:
- '*'
release:
types:
- created
pull_request: # Test luarocks install without publishing on PR
workflow_dispatch:

jobs:
luarocks-upload:
runs-on: ubuntu-22.04
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: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
version: ${{ env.LUAROCKS_VERSION }}
template: "./.github/workflows/template.rockspec"
dependencies: |
lua ~> 5.1
22 changes: 22 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
permissions:
contents: write
pull-requests: write

name: Release Please

on:
workflow_dispatch:
push:
branches:
- main

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
with:
release-type: simple
token: ${{ secrets.PAT }}
81 changes: 0 additions & 81 deletions .github/workflows/release.yaml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/template.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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

build_dependencies = {
'luarocks-build-rust-mlua',
}

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 = "rust-mlua",

modules = {
["libblink_cmp_fuzzy"] = "blink_cmp_fuzzy",
},

install = {
lua = {
["blink-cmp.init"] = "lua/blink-cmp.lua",
},
},

copy_directories = $copy_directories,
}
Loading

0 comments on commit b9a195b

Please sign in to comment.