diff options
| author | Marc Jakobi <mrcjkb89@outlook.com> | 2023-01-06 23:58:19 +0100 |
|---|---|---|
| committer | Matthieu Coudron <teto@users.noreply.github.com> | 2023-01-08 18:59:12 +0100 |
| commit | 2df0fbdadd947cd2995566a0117b8802a9ba74f4 (patch) | |
| tree | 438a2056daebdd70c4058d35b5e30a7bed5f1143 | |
| parent | docs: fix typo (#2382) (diff) | |
| download | nvim-lspconfig-0.1.5.tar nvim-lspconfig-0.1.5.tar.gz nvim-lspconfig-0.1.5.tar.bz2 nvim-lspconfig-0.1.5.tar.lz nvim-lspconfig-0.1.5.tar.xz nvim-lspconfig-0.1.5.tar.zst nvim-lspconfig-0.1.5.zip | |
ci: add luarocks upload release workflowv0.1.5
The recently added rockspec (see #2307) has to be prepared and
uploaded to luarocks for each release.
This adds an automated workflow for it, which has been tested with
plenary.nvim.
To be able to upload to luarocks, the owner of the luarocks account
will have to add an API key named `LUAROCKS_API_KEY` to this repo's
GitHub Actions secrets.
| -rw-r--r-- | .github/workflows/release.yml | 22 | ||||
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | scripts/luarocks-upload.sh | 10 | ||||
| -rw-r--r-- | scripts/test-luarocks-install.sh | 4 |
4 files changed, 42 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..11ce428d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: "release" +on: + push: + tags: + - '*' +jobs: + luarocks-upload: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: leafo/gh-actions-lua@v9 + with: + luaVersion: "luajit-2.1.0-beta3" + - uses: leafo/gh-actions-luarocks@v4 + - name: Install dkjson + run: luarocks install dkjson + - name: Luarocks Upload + env: + LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} + run: make luarocks_upload + - name: Install release + run: make test_luarocks_install @@ -10,3 +10,9 @@ lint: stylua --check . .PHONY: test lint + +luarocks_upload: + bash ./scripts/luarocks-upload.sh + +test_luarocks_install: + bash ./scripts/test-luarocks-install.sh diff --git a/scripts/luarocks-upload.sh b/scripts/luarocks-upload.sh new file mode 100644 index 00000000..8c4ff1f4 --- /dev/null +++ b/scripts/luarocks-upload.sh @@ -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/nvim-lspconfig-$MODREV-1.rockspec" +cp "nvim-lspconfig-scm-1.rockspec" "$DEST_ROCKSPEC" +sed -i "s/= 'scm'/= '$MODREV'/g" "$DEST_ROCKSPEC" +luarocks upload "$DEST_ROCKSPEC" --api-key="$LUAROCKS_API_KEY" diff --git a/scripts/test-luarocks-install.sh b/scripts/test-luarocks-install.sh new file mode 100644 index 00000000..8d8d3242 --- /dev/null +++ b/scripts/test-luarocks-install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +MODREV=$(git describe --tags --always --first-parent | tr -d "v") +luarocks install "nvim-lspconfig" "$MODREV" |
