Skip to content

Commit 762f79f

Browse files
committed
🏗️ Use luarocks-build-embedded-rockspecs
1 parent b797577 commit 762f79f

File tree

5 files changed

+68
-83
lines changed

5 files changed

+68
-83
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,23 @@
1010
- doc/*
1111
workflow_dispatch:
1212

13-
# https://github.com/softprops/action-gh-release/issues/236
14-
permissions:
15-
contents: write
16-
1713
jobs:
1814
build:
1915
runs-on: ubuntu-latest
2016
steps:
2117
- uses: actions/checkout@v4
22-
- uses: leafo/gh-actions-lua@v10
23-
with:
24-
luaVersion: "5.1"
25-
- uses: leafo/gh-actions-luarocks@v4
26-
- name: Build
27-
run: |
28-
luarocks install --local \
29-
--tree ~/work/code-stats.nvim/code-stats.nvim/.luarocks \
30-
assets/rockspecs/xml-1.1.3-1.rockspec
31-
luarocks pack ./*.rockspec
32-
luarocks build
33-
luarocks pack code-stats.nvim
34-
- uses: actions/upload-artifact@v4
18+
- uses: nvim-neorocks/luarocks-tag-release@v7
19+
env:
20+
LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}}
3521
if: "! startsWith(github.ref, 'refs/tags/')"
3622
with:
37-
path: |
38-
*.rock
39-
- uses: softprops/action-gh-release@v2
23+
extra_luarocks_args: |
24+
--force
25+
version: scm
26+
- uses: nvim-neorocks/luarocks-tag-release@v5
27+
env:
28+
LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}}
4029
if: startsWith(github.ref, 'refs/tags/')
4130
with:
42-
# body_path: build/CHANGELOG.md
43-
files: |
44-
*.rock
45-
- name: Upload
46-
# if: startsWith(github.ref, 'refs/tags/')
47-
run: |
48-
luarocks install luajson
49-
luarocks upload --force --api-key ${{secrets.LUAROCKS_API_KEY}} \
50-
./*.rockspec
31+
extra_luarocks_args: |
32+
--force

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
hooks:
2626
- id: remove-crlf
2727
- repo: https://github.com/codespell-project/codespell
28-
rev: v2.3.0
28+
rev: v2.4.0
2929
hooks:
3030
- id: codespell
3131
additional_dependencies:
@@ -37,23 +37,23 @@ repos:
3737
args:
3838
- --msg-filename
3939
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
40-
rev: 3.0.3
40+
rev: 3.1.3
4141
hooks:
4242
- id: editorconfig-checker
4343
- repo: https://github.com/jumanjihouse/pre-commit-hooks
4444
rev: 3.0.0
4545
hooks:
4646
- id: check-mailmap
4747
- repo: https://github.com/rhysd/actionlint
48-
rev: v1.7.4
48+
rev: v1.7.7
4949
hooks:
5050
- id: actionlint
5151
- repo: https://github.com/adrienverge/yamllint
5252
rev: v1.35.1
5353
hooks:
5454
- id: yamllint
5555
- repo: https://github.com/executablebooks/mdformat
56-
rev: 0.7.19
56+
rev: 0.7.21
5757
hooks:
5858
- id: mdformat
5959
additional_dependencies:
@@ -67,7 +67,7 @@ repos:
6767
- mdformat-config
6868
- mdformat-web
6969
- repo: https://github.com/DavidAnson/markdownlint-cli2
70-
rev: v0.16.0
70+
rev: v0.17.2
7171
hooks:
7272
- id: markdownlint-cli2
7373
additional_dependencies:

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434

3535
## Install
3636

37-
**NOTE**: upstream xml has been [broken](https://github.com/lubyk/xml/pull/20).
38-
use the [fork](assets/rockspecs/xml-1.1.3-1.rockspec) before installing.
39-
4037
### rocks.nvim
4138

4239
#### Command style

code-stats.nvim-scm-1.rockspec

Lines changed: 0 additions & 46 deletions
This file was deleted.

assets/rockspecs/xml-1.1.3-1.rockspec renamed to template.rockspec

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,53 @@
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+
detailed = $detailed_description,
14+
labels = $labels,
15+
homepage = '$homepage',
16+
$license
17+
}
18+
19+
build_dependencies = { 'luarocks-build-embedded-rockspecs' }
20+
21+
dependencies = { 'lua >= 5.1', 'lua-requests', 'lua-dotenv' }
22+
23+
test_dependencies = $test_dependencies
24+
25+
source = {
26+
url = repo_url .. '/archive/' .. git_ref .. '.zip',
27+
dir = '$repo_name-' .. '$archive_dir_suffix',
28+
}
29+
30+
if modrev == 'scm' or modrev == 'dev' then
31+
source = {
32+
url = repo_url:gsub('https', 'git')
33+
}
34+
end
35+
36+
build = {
37+
type = "embedded-rockspecs",
38+
delegate_type = "builtin",
39+
copy_directories = $copy_directories,
40+
install = {
41+
conf = {
42+
['..'] = 'shell.nix',
43+
['../scripts/update.sh'] = 'scripts/update.sh',
44+
['../scripts/get-OPENSSL_INCDIR.nix'] = 'scripts/get-OPENSSL_INCDIR.nix',
45+
['../scripts/get-OPENSSL_LIBDIR.nix'] = 'scripts/get-OPENSSL_LIBDIR.nix',
46+
['../scripts/get-STDCPP_LIBDIR.nix'] = 'scripts/get-STDCPP_LIBDIR.nix',
47+
},
48+
},
49+
rockspecs = {
50+
[==[
151
package = "xml"
252
version = "1.1.3-1"
353
source = {
@@ -72,3 +122,5 @@ build = {
72122
},
73123
},
74124
}
125+
]==],
126+
}

0 commit comments

Comments
 (0)