Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish

on:
push:
tags: v[0-9]+.[0-9]+.[0-9]+.[0-9]+*

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
env:
package_name: lls-addon-luafilesystem
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@v4

- name: Set up Lua
uses: leafo/gh-actions-lua@v11
with:
luaVersion: "5.4.8"

- name: Set up LuaRocks
uses: leafo/gh-actions-luarocks@v5
with:
luaRocksVersion: "3.12.2"

- 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"
22 changes: 22 additions & 0 deletions lls-addon-luafilesystem-release-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
rockspec_format = "3.0"
package = "lls-addon-luafilesystem"
version = "release-1"

source = {
url = "git+https://github.com/LuaCATS/luafilesystem",
}

description = {
summary = "LuaLS type definitions for LuaFileSystem library",
license = "MIT",
homepage = "https://github.com/LuaCATS/luafilesystem",
}

build = {
type = "lls-addon",
settings = {
diagnostics = {
globals = { "lfs" },
}
}
}