Skip to content

Commit

Permalink
👷 Add luarocks-tag-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Jun 21, 2024
1 parent c295ae5 commit 5633cdd
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 60 deletions.
30 changes: 6 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: leafo/gh-actions-lua@v10
- uses: leafo/gh-actions-luarocks@v4
- name: Build
run: |
luarocks pack ./*.rockspec
luarocks build
luarocks pack prompt-style
- uses: actions/upload-artifact@v3
if: "! startsWith(github.ref, 'refs/tags/')"
- uses: actions/checkout@v4
- uses: nvim-neorocks/luarocks-tag-release@v5
env:
LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}}
with:
path: |
*.rock
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
# body_path: build/CHANGELOG.md
files: |
*.rock
- name: Upload
if: startsWith(github.ref, 'refs/tags/')
run: |
# https://github.com/luarocks/luarocks/issues/559
luarocks install dkjson
luarocks upload ./*.rockspec --api-key ${{secrets.LUAROCKS_API_KEY}}
template: template.rockspec
name: prompt-style

deploy-aur:
needs: build
Expand Down
36 changes: 0 additions & 36 deletions prompt-style-0.0.1-0.rockspec

This file was deleted.

51 changes: 51 additions & 0 deletions template.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
local git_ref = '$git_ref'
local modrev = '$modrev'
local specrev = '$specrev'

local repo_url = '$repo_url'

rockspec_format = '3.0'
package = '$package'
version = modrev ..'-'.. specrev

description = {
summary = '$summary',
detailed = $detailed_description,
labels = $labels,
homepage = '$homepage',
$license
}

dependencies = {
"lua >= 5.1",
"ansicolors",
"luafilesystem",
"luaprompt"
}

test_dependencies = $test_dependencies

source = {
url = repo_url .. '/archive/' .. git_ref .. '.zip',
dir = '$repo_name-' .. '$archive_dir_suffix',
}

if modrev == 'scm' or modrev == 'dev' then
source = {
url = repo_url:gsub('https', 'git')
}
end

build = {
type = 'builtin',
modules = {["prompt-style"] = "prompt-style.lua"},
install = {
-- cannot use _VERSION
bin = {
"bin/nvimp",
"bin/texluap",
"bin/pandocp",
"bin/neomuttp"
},
},
}

0 comments on commit 5633cdd

Please sign in to comment.