diff --git a/.github/chglog/CHANGELOG.release.md b/.github/chglog/CHANGELOG.release.md index 509961ff..c89d09bd 100644 --- a/.github/chglog/CHANGELOG.release.md +++ b/.github/chglog/CHANGELOG.release.md @@ -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 "${1}${2}") $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 "${1}${2}") $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 -}}
{{ else -}}- {{ end -}} - {{.Hash.Short}} {{ $subject }} - {{- if $list -}} - {{ printf " %s " "(closes"}} - {{- range $idx, $ref := $list -}}{{ if $idx }}, {{ end -}} - #{{ $ref.Ref}}{{ end }}) - {{- end -}} +{{.Hash.Short}} {{ $subject }} +{{- if $list -}} +{{ printf " %s " "(closes"}} +{{- range $idx, $ref := $list -}}{{ if $idx }}, {{ end -}} + #{{ $ref.Ref}}{{ end }}) +{{- end -}} {{ if .TrimmedBody -}}{{ printf "\n\n%s\n\n" .TrimmedBody }}
{{ end }} {{ end }} {{ end }} -{{- if .RevertCommits -}} -### Reverts - -{{ range .RevertCommits -}} -* {{ .Revert.Header }} -{{ end }} -{{ end -}} - {{- if .NoteGroups -}} {{ range .NoteGroups -}} ### {{ .Title }} @@ -45,3 +39,4 @@ {{ end -}} {{ end -}} {{ end -}} +{{ end -}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f735d72..31bfa6c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,9 +29,17 @@ jobs: - name: Install required utils run: | - apt-get update - apt-get -y install luarocks go get github.com/git-chglog/git-chglog/cmd/git-chglog + apt-get update -y lua sudo unzip + apt-get -y install build-essential libreadline-dev + wget https://luarocks.org/releases/luarocks-3.7.0.tar.gz + wget https://luarocks.org/releases/luarocks-3.3.1.tar.gz + tar zxpf luarocks-3.3.1.tar.gz + cd luarocks-3.3.1 + ./configure --with-lua-include=/usr/local/include + make; make install + cd - + echo $(luarocks --version) - name: Setup Environment run: | @@ -49,6 +57,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 \ @@ -59,7 +69,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: | diff --git a/scripts/gen_rockspec.lua b/scripts/gen_rockspec.lua index fd20c3a3..55c8f518 100644 --- a/scripts/gen_rockspec.lua +++ b/scripts/gen_rockspec.lua @@ -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