Skip to content

Commit 216544e

Browse files
committed
🐛 luarocks auto-generate script
Having "/" in the start of path breaks luarocks installation. closes #115
1 parent ca8233f commit 216544e

File tree

3 files changed

+24
-26
lines changed

3 files changed

+24
-26
lines changed
Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,34 @@
11
{{- $repourl := $.Info.RepositoryURL -}}
22

3+
{{ range .Versions }}
4+
{{ if eq .Tag.Name "CIGTAG" }}
35
{{ range .CommitGroups -}}
46
## {{ .Title }}
57

68
{{ range .Commits -}}
7-
{{- /** Remove markdown urls when there's a pull request linked and replace it with a tag **/ -}}
8-
{{- $subject := (regexReplaceAll `URL` (regexReplaceAll `\[(.*)(\d\d)\]\(.*?\)` .Subject "<a href=\"URL/pull/${2}\">${1}${2}</a>") $repourl) -}}
9-
{{- /** Filter out refs mentioned in the title **/ -}}
10-
{{- $list := (list) -}}
11-
{{- range $idx, $ref := .Refs -}}
12-
{{- if not (regexMatch $ref.Ref $subject) -}}
13-
{{ $list = append $list $ref }}
14-
{{- end -}}
15-
{{- end -}}
16-
{{- /** end custom varaibles **/ -}}
9+
{{- /** Remove markdown urls when there's a pull request linked and replace it with a tag **/ -}}
10+
{{- $subject := (regexReplaceAll `URL` (regexReplaceAll `\[(.*)(\d\d)\]\(.*?\)` .Subject "<a href=\"URL/pull/${2}\">${1}${2}</a>") $repourl) -}}
11+
{{- /** Filter out refs mentioned in the title **/ -}}
12+
{{- $list := (list) -}}
13+
{{- range $idx, $ref := .Refs -}}
14+
{{- if not (regexMatch $ref.Ref $subject) -}}
15+
{{ $list = append $list $ref }}
16+
{{- end -}}
17+
{{- end -}}
18+
{{- /** end custom variables **/ -}}
1719

1820
{{ if .TrimmedBody -}}<dl><dd><details><summary>{{ else -}}- {{ end -}}
19-
<a href="{{$repourl}}/commit/{{.Hash.Long}}"><tt>{{.Hash.Short}}</tt></a> {{ $subject }}
20-
{{- if $list -}}
21-
{{ printf " %s " "(closes"}}
22-
{{- range $idx, $ref := $list -}}{{ if $idx }}, {{ end -}}
23-
<a href="{{ $repourl }}/issues/{{ $ref.Ref}}"> #{{ $ref.Ref}}</a>{{ end }})
24-
{{- end -}}
21+
<a href="{{$repourl}}/commit/{{.Hash.Long}}"><tt>{{.Hash.Short}}</tt></a> {{ $subject }}
22+
{{- if $list -}}
23+
{{ printf " %s " "(closes"}}
24+
{{- range $idx, $ref := $list -}}{{ if $idx }}, {{ end -}}
25+
<a href="{{ $repourl }}/issues/{{ $ref.Ref}}"> #{{ $ref.Ref}}</a>{{ end }})
26+
{{- end -}}
2527
{{ if .TrimmedBody -}}</summary>{{ printf "\n\n%s\n\n" .TrimmedBody }}</details></dd></dl>{{ end }}
2628

2729
{{ end }}
2830
{{ end }}
2931

30-
{{- if .RevertCommits -}}
31-
### Reverts
32-
33-
{{ range .RevertCommits -}}
34-
* {{ .Revert.Header }}
35-
{{ end }}
36-
{{ end -}}
37-
3832
{{- if .NoteGroups -}}
3933
{{ range .NoteGroups -}}
4034
### {{ .Title }}
@@ -45,3 +39,4 @@
4539
{{ end -}}
4640
{{ end -}}
4741
{{ end -}}
42+
{{ end -}}

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
apt-get update
3333
apt-get -y install luarocks
3434
go get github.com/git-chglog/git-chglog/cmd/git-chglog
35+
ehco $(luarocks --version)
3536
-
3637
name: Setup Environment
3738
run: |
@@ -49,6 +50,8 @@ jobs:
4950
-
5051
name: Generate changelog
5152
run: |
53+
sed -i "s/CIGTAG/${{ steps.tag.outputs.TAG }}/g" .github/chglog/CHANGELOG.release.md
54+
5255
$(go env GOPATH)/bin/git-chglog \
5356
-c .github/chglog/config.yml \
5457
-t .github/chglog/CHANGELOG.release.md \
@@ -59,7 +62,7 @@ jobs:
5962
run: |
6063
export GTAG=${{ steps.tag.outputs.TAG }}
6164
export PATH="${PWD}/build/:${PATH}"
62-
make genluarock
65+
make gen_luarock
6366
-
6467
name: Update version in files
6568
run: |

scripts/gen_rockspec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies = c(dependencies)
2929

3030
--- Format modules ----------------------------------------
3131
for _, v in ipairs(scandir(cwd, { search_pattern = "/lua/sqlite/[^examples]" })) do
32-
local path = v:gsub(cwd, "")
32+
local path = v:gsub(cwd .. "/", "")
3333
local module = path:gsub("/", "%."):gsub(".lua.(.-).lua", "%1")
3434
modules[module] = path
3535
end

0 commit comments

Comments
 (0)