Skip to content

Commit c493f2a

Browse files
committed
ci: add automatic LuaRocks publishing to release workflow
- Add LuaRocks publishing step to release workflow - Include LuaRocks installation instructions in release notes - Add validation and error handling for rockspec files - Support for LUAROCKS_API_KEY secret for authentication
1 parent 18400fe commit c493f2a

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
5858
## Installation
5959
60+
### Git
6061
```lua
6162
{
6263
"hydepwns/mona.nvim",
@@ -67,5 +68,37 @@ jobs:
6768
}
6869
}
6970
```
71+
72+
### LuaRocks
73+
```bash
74+
luarocks install mona.nvim
75+
```
7076
draft: false
71-
prerelease: false
77+
prerelease: false
78+
79+
- name: Publish to LuaRocks
80+
if: startsWith(github.ref, 'refs/tags/v')
81+
run: |
82+
# Extract version from tag (e.g., v0.1.3 -> 0.1.3)
83+
VERSION=${GITHUB_REF#refs/tags/v}
84+
ROCKSPEC="mona.nvim-${VERSION}-1.rockspec"
85+
86+
echo "Publishing $ROCKSPEC to LuaRocks..."
87+
88+
# Check if rockspec exists
89+
if [ ! -f "$ROCKSPEC" ]; then
90+
echo "Error: $ROCKSPEC not found"
91+
exit 1
92+
fi
93+
94+
# Validate rockspec
95+
luarocks validate "$ROCKSPEC"
96+
97+
# Upload to LuaRocks (requires API key)
98+
if [ -n "${{ secrets.LUAROCKS_API_KEY }}" ]; then
99+
echo "Uploading to LuaRocks..."
100+
luarocks upload "$ROCKSPEC" --api-key "${{ secrets.LUAROCKS_API_KEY }}"
101+
else
102+
echo "Warning: LUAROCKS_API_KEY not set, skipping LuaRocks upload"
103+
echo "To enable automatic LuaRocks publishing, add LUAROCKS_API_KEY to repository secrets"
104+
fi

0 commit comments

Comments
 (0)