Skip to content

Commit

Permalink
ci: add luarocks upload release workflow (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Jan 6, 2023
1 parent bb44479 commit 345092e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "release"
on:
push:
tags:
- 'v*'
jobs:
luarocks-upload:
runs-on: ubuntu-20.04
steps:
- uses: leafo/gh-actions-lua@v9
- uses: leafo/gh-actions-luarocks@v4
- name: Install dkjson
run: luarocks install dkjson
- name: Luarocks Upload
run: make luarocks_upload
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ test:

generate_filetypes:
nvim --headless -c 'luafile scripts/update_filetypes_from_github.lua' -c 'qa!'

luarocks_upload:
bash ./scripts/luarocks-upload.sh
10 changes: 10 additions & 0 deletions scripts/luarocks-upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# Expects the LUAROCKS_API_KEY secret to be set

TMP_DIR=$(mktemp -d)
MODREV=$(git describe --tags --always --first-parent | tr -d "v")
DEST_ROCKSPEC="$TMP_DIR/plenary.nvim-$MODREV-1.rockspec"
cp "plenary.nvim-scm-1.rockspec" "$DEST_ROCKSPEC"
sed -i "s/'scm'/'$MODREV'/g" "$DEST_ROCKSPEC"
luarocks upload "$DEST_ROCKSPEC" --api-key="$LUAROCKS_API_KEY"

0 comments on commit 345092e

Please sign in to comment.