Skip to content

Commit

Permalink
🐛 luarocks auto-generate script
Browse files Browse the repository at this point in the history
Having "/" in the start of path breaks luarocks installation.

closes #115
  • Loading branch information
kkharji committed Sep 9, 2021
1 parent ca8233f commit 216544e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
43 changes: 19 additions & 24 deletions .github/chglog/CHANGELOG.release.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
{{- $repourl := $.Info.RepositoryURL -}}

{{ range .Versions }}
{{ if eq .Tag.Name "CIGTAG" }}
{{ range .CommitGroups -}}
## {{ .Title }}

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

{{ if .TrimmedBody -}}<dl><dd><details><summary>{{ else -}}- {{ end -}}
<a href="{{$repourl}}/commit/{{.Hash.Long}}"><tt>{{.Hash.Short}}</tt></a> {{ $subject }}
{{- if $list -}}
{{ printf " %s " "(closes"}}
{{- range $idx, $ref := $list -}}{{ if $idx }}, {{ end -}}
<a href="{{ $repourl }}/issues/{{ $ref.Ref}}"> #{{ $ref.Ref}}</a>{{ end }})
{{- end -}}
<a href="{{$repourl}}/commit/{{.Hash.Long}}"><tt>{{.Hash.Short}}</tt></a> {{ $subject }}
{{- if $list -}}
{{ printf " %s " "(closes"}}
{{- range $idx, $ref := $list -}}{{ if $idx }}, {{ end -}}
<a href="{{ $repourl }}/issues/{{ $ref.Ref}}"> #{{ $ref.Ref}}</a>{{ end }})
{{- end -}}
{{ if .TrimmedBody -}}</summary>{{ printf "\n\n%s\n\n" .TrimmedBody }}</details></dd></dl>{{ end }}

{{ end }}
{{ end }}

{{- if .RevertCommits -}}
### Reverts

{{ range .RevertCommits -}}
* {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
Expand All @@ -45,3 +39,4 @@
{{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
apt-get update
apt-get -y install luarocks
go get github.com/git-chglog/git-chglog/cmd/git-chglog
ehco $(luarocks --version)
-
name: Setup Environment
run: |
Expand All @@ -49,6 +50,8 @@ jobs:
-
name: Generate changelog
run: |
sed -i "s/CIGTAG/${{ steps.tag.outputs.TAG }}/g" .github/chglog/CHANGELOG.release.md
$(go env GOPATH)/bin/git-chglog \
-c .github/chglog/config.yml \
-t .github/chglog/CHANGELOG.release.md \
Expand All @@ -59,7 +62,7 @@ jobs:
run: |
export GTAG=${{ steps.tag.outputs.TAG }}
export PATH="${PWD}/build/:${PATH}"
make genluarock
make gen_luarock
-
name: Update version in files
run: |
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen_rockspec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = c(dependencies)

--- Format modules ----------------------------------------
for _, v in ipairs(scandir(cwd, { search_pattern = "/lua/sqlite/[^examples]" })) do
local path = v:gsub(cwd, "")
local path = v:gsub(cwd .. "/", "")
local module = path:gsub("/", "%."):gsub(".lua.(.-).lua", "%1")
modules[module] = path
end
Expand Down

0 comments on commit 216544e

Please sign in to comment.