Skip to content

Commit 70d53a6

Browse files
authored
chore: improve license reporting #626 (#627)
* chore: improve license reporting #626 * chore: ignore error #626
1 parent 43154af commit 70d53a6

File tree

47 files changed

+18
-2567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+18
-2567
lines changed

.github/workflows/gen-docs.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ jobs:
5151
git checkout gh_pages
5252
git merge -X theirs origin/main --allow-unrelated-histories
5353
54-
GOBIN=/tmp/ go install github.com/google/go-licenses@v1.0.0
55-
/tmp/go-licenses csv ./cmd/apigeecli > third-party-licenses.txt || echo "Ignore warnings"
56-
/tmp/go-licenses save ./cmd/apigeecli --save_path=third-party --force || echo "Ignore warnings"
54+
GOBIN=/tmp/ go install github.com/google/go-licenses@v1.6.0
55+
/tmp/go-licenses report ./... --template licenses.tpl --ignore internal > third-party-licenses.txt 2> /dev/null || echo "Ignore warnings"
56+
# /tmp/go-licenses save ./cmd/apigeecli --save_path=third-party --force || echo "Ignore warnings"
5757
58-
git add third-party third-party-licenses.txt
58+
# git add third-party third-party-licenses.txt
59+
git add third-party-licenses.txt
5960
git commit -m "generate licenses - $SHORT_SHA" || echo "No Changes in license"
6061
6162
go run docs/docs.go

.github/workflows/licenses.tpl

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{ range . }}
2+
## {{ .Name }}
3+
4+
* Name: {{ .Name }}
5+
* Version: {{ .Version }}
6+
* License: [{{ .LicenseName }}]({{ .LicenseURL }})
7+
8+
```
9+
{{ .LicenseText }}
10+
```
11+
{{ end }}

.goreleaser.yml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ archives:
6363
wrap_in_directory: true
6464
files:
6565
- LICENSE.txt
66+
- third-party-licenses.txt
6667
builds:
6768
- apigeecli
6869

Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ WORKDIR /go/src/apigeecli
2727
ENV GO111MODULE=on
2828
RUN go mod tidy
2929
RUN go mod download
30-
RUN date +%FT%H:%I:%M+%Z > /tmp/date
31-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -buildvcs=true -a -gcflags='all="-l"' -ldflags='-s -w -extldflags "-static" -X main.version='${TAG}' -X main.commit='${COMMIT}' -X main.date='$(cat /tmp/date) -o /go/bin/apigeecli /go/src/apigeecli/cmd/apigeecli/apigeecli.go
30+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -buildvcs=true -a -gcflags='all="-l"' -ldflags='-s -w -extldflags "-static" -X main.version='${TAG}' -X main.commit='${COMMIT}' -X main.date='$(date +%FT%H:%I:%M+%Z) -o /go/bin/apigeecli /go/src/apigeecli/cmd/apigeecli/apigeecli.go
3231

3332
FROM ghcr.io/jqlang/jq:1.7.1@sha256:096b83865ad59b5b02841f103f83f45c51318394331bf1995e187ea3be937432 AS jq
3433

third-party/LICENSE.txt

-202
This file was deleted.

0 commit comments

Comments
 (0)