Skip to content

Commit

Permalink
ci: add luarocks upload release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jan 3, 2023
1 parent 4b7e520 commit 1311488
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)
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 1311488

Please sign in to comment.