Skip to content

Commit 345092e

Browse files
authored
ci: add luarocks upload release workflow (#435)
see nvim-telescope/telescope.nvim#2276 (comment).
1 parent bb44479 commit 345092e

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "release"
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
jobs:
7+
luarocks-upload:
8+
runs-on: ubuntu-20.04
9+
steps:
10+
- uses: leafo/gh-actions-lua@v9
11+
- uses: leafo/gh-actions-luarocks@v4
12+
- name: Install dkjson
13+
run: luarocks install dkjson
14+
- name: Luarocks Upload
15+
run: make luarocks_upload

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ test:
33

44
generate_filetypes:
55
nvim --headless -c 'luafile scripts/update_filetypes_from_github.lua' -c 'qa!'
6+
7+
luarocks_upload:
8+
bash ./scripts/luarocks-upload.sh

scripts/luarocks-upload.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# Expects the LUAROCKS_API_KEY secret to be set
4+
5+
TMP_DIR=$(mktemp -d)
6+
MODREV=$(git describe --tags --always --first-parent | tr -d "v")
7+
DEST_ROCKSPEC="$TMP_DIR/plenary.nvim-$MODREV-1.rockspec"
8+
cp "plenary.nvim-scm-1.rockspec" "$DEST_ROCKSPEC"
9+
sed -i "s/'scm'/'$MODREV'/g" "$DEST_ROCKSPEC"
10+
luarocks upload "$DEST_ROCKSPEC" --api-key="$LUAROCKS_API_KEY"

0 commit comments

Comments
 (0)