-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (44 loc) · 1.37 KB
/
publish.yml
File metadata and controls
53 lines (44 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Publish
on:
push:
tags: v[0-9]+.[0-9]+.[0-9]+*
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
env:
package_name: luarocks-build-lls-addon
spec_version: "" # this gets set in the Get Rockspec Version step
steps:
- name: Get Rockspec Version
run: |
if [[ "${{ github.ref_name }}" =~ ^v(.+)$ ]]; then
echo "spec_version=${BASH_REMATCH[1]}-1" >> $GITHUB_ENV
else
echo "rockspec version could not be matched" >&2
exit 1
fi
- uses: actions/checkout@v6
- name: Set up Lua
uses: leafo/gh-actions-lua@v12
with:
luaVersion: "5.4"
- name: Set up LuaRocks
uses: leafo/gh-actions-luarocks@v6
with:
luaRocksVersion: "3.13.0"
- name: Write LuaRocks Rockspec
run: |
luarocks new_version \
--tag ${{ github.ref_name }} \
${{ env.package_name }}-release-1.rockspec
- name: Publish to LuaRocks
run: |
luarocks upload \
"./${{ env.package_name }}-${{ env.spec_version }}.rockspec" \
--api-key=${{ secrets.LUAROCKS_API_KEY }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: "${{ env.package_name }}-${{ env.spec_version }}.src.rock"