-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{- define "depInfo" -}} | ||
{{- range $i, $dep := . }} | ||
{{ "-" | line }} | ||
Module : {{ $dep.Name }} | ||
Version : {{ $dep.Version }} | ||
Time : {{ $dep.VersionTime }} | ||
Licence : {{ $dep.LicenceType }} | ||
|
||
{{ $dep | licenceText }} | ||
{{ end }} | ||
{{- end -}} | ||
|
||
Copyright 2023-{{ currentYear }} Quesma Inc | ||
|
||
This product includes software developed by The Apache Software | ||
Foundation (http://www.apache.org/). | ||
|
||
{{ "=" | line }} | ||
Third party libraries used by the quesma project | ||
{{ "=" | line }} | ||
|
||
{{ template "depInfo" .Direct }} | ||
|
||
{{ if .Indirect }} | ||
{{ "=" | line }} | ||
Indirect dependencies | ||
|
||
{{ template "depInfo" .Indirect }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{{- define "depRow" -}} | ||
{{- range $i, $dep := . }} | ||
| link:{{ $dep.URL }}[$${{ $dep.Name }}$$] | {{ $dep.Version }} | {{ $dep.LicenceType }} | ||
{{- end }} | ||
{{- end -}} | ||
// Generated documentation. Please do not edit. | ||
:page_id: dependencies | ||
ifdef::env-github[] | ||
**** | ||
link:https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-{page_id}.html[View this document on the Elastic website] | ||
**** | ||
endif::[] | ||
|
||
[id="{p}-{page_id}"] | ||
= Third-party dependencies | ||
|
||
This page lists the third-party dependencies used to build {n}. | ||
|
||
[float] | ||
[id="{p}-dependencies-direct"] | ||
== Direct dependencies | ||
|
||
[options="header"] | ||
|=== | ||
| Name | Version | Licence | ||
{{ template "depRow" .Direct }} | ||
|=== | ||
|
||
{{ if .Indirect }} | ||
[float] | ||
[id="{p}-dependencies-indirect"] | ||
== Indirect dependencies | ||
|
||
[options="header"] | ||
|=== | ||
| Name | Version | Licence | ||
{{ template "depRow" .Indirect }} | ||
|=== | ||
{{ end }} | ||
|
||
[float] | ||
[id="{p}-dependencies-image"] | ||
== Container image dependencies | ||
|
||
Dependencies included in the {n} container image. | ||
|
||
[options="header",format="csv"] | ||
|=== | ||
Name, Version, Licence, URL | ||
include::container-image-dependencies.csv[] | ||
|=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Generate NOTICE.MD | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
generate-notice-file: | ||
strategy: | ||
matrix: | ||
module: [ "quesma" ] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
repository-projects: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache-dependency-path: ${{ matrix.module }}/go.sum | ||
go-version: '1.22' | ||
|
||
- name: Install go-licence-detector | ||
working-directory: ${{ matrix.module }} | ||
run: go get go.elastic.co/go-licence-detector && go install go.elastic.co/go-licence-detector | ||
|
||
- name: Generate NOTICE.MD | ||
working-directory: ${{ matrix.module }} | ||
run: | | ||
go list -m -json all | go-licence-detector -includeIndirect -noticeTemplate=../.github/templates/NOTICE.txt.tmpl -noticeOut=../NOTICE.MD -depsTemplate=../.github/templates/dependencies.asciidoc.tmpl -depsOut=dependencies.asciidoc | ||
rm dependencies.asciidoc | ||
- name: Print NOTICE.MD | ||
run: cat NOTICE.MD | ||
|
||
- name: Check if NOTICE.MD changed | ||
id: notice-file-changed | ||
run: | | ||
git fetch origin | ||
if git ls-tree --name-only origin/main | grep -q '^NOTICE.MD$'; then | ||
if git diff --exit-code origin/main -- NOTICE.MD; then | ||
echo "::set-output name=changed::false" | ||
else | ||
echo "::set-output name=changed::true" | ||
fi | ||
else | ||
echo "::set-output name=changed::true" | ||
fi | ||
- name: Issue a Pull Request | ||
if: steps.notice-file-changed.outputs.changed == 'true' | ||
run: | | ||
BRANCH_NAME="notice/$(date +%Y%m%d%H%M%S)" | ||
git checkout -b "$BRANCH_NAME" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Quesma AI" | ||
git add NOTICE.MD | ||
git commit -m "Update NOTICE.MD" | ||
git push origin HEAD | ||
gh pr create --dry-run -l notice.md --title "Update NOTICE.MD" --body "There's been a change in Quesma dependencies. Updating \\\`NOTICE.MD\\\`" --base main --head "$BRANCH_NAME" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
|