Skip to content

build: publish LICENSE and NOTICE with the generated site - #671

Open
NopeCharon wants to merge 1 commit into
konflux-ci:mainfrom
NopeCharon:publish-license
Open

NopeCharon wants to merge 1 commit into
konflux-ci:mainfrom
NopeCharon:publish-license

Conversation

@NopeCharon

Copy link
Copy Markdown

The repository is licensed under Apache 2.0 since #664, but the build and deployment workflows publish only Antora's public output. As a result, the production site, the Netlify previews, and the downloadable website artifact don't include a copy of the license. Apache 2.0 §4(a) and §4(d) require that recipients get the license and the NOTICE file.

This PR adds a small Antora extension (antora-extensions/publish-license-files.js), registered in antora-playbook.yml. Before publishing, it reads LICENSE and NOTICE from the playbook directory and adds them to the site catalog, so both end up at the root of the generated site (for example https://konflux-ci.dev/docs/LICENSE).

I did this in the playbook instead of adding a cp step to the build script because:

  • the files follow Antora's configured output directory, including --to-dir
  • hack/local-build.sh and plain npx antora builds include them too
  • a copy step at the end of npm run build would receive any extra arguments passed with npm run build -- ... and break

If either file is missing, the build fails, so the site can't be published without them. The Font Awesome license files are already published under _/font-awesome-4.7.0/ through the supplemental UI files, so nothing changes there.

Testing (local, Node 18):

  • npm run build: public/LICENSE and public/NOTICE are created and are byte-identical to the repository files. The sitemap and the search index are unchanged, and npm run generate-llms-txt still works.
  • npx antora generate --to-dir <dir> antora-playbook.yml: both files are written to the custom output directory.
  • With NOTICE temporarily removed, the build fails with an ENOENT error naming the missing file.

Fixes #665

The repository is licensed under the Apache License 2.0, but the build
and deployment workflows only publish Antora's output directory, so the
production site, Netlify previews, and the downloadable website artifact
did not include a copy of the license. Section 4 of the license requires
redistributions to give recipients a copy of the license and of the
NOTICE file.

Add a small Antora extension that reads LICENSE and NOTICE from the
playbook directory and adds them to the site catalog before publishing,
so they are written to the root of the generated site (for example,
https://konflux-ci.dev/docs/LICENSE).

Doing this in the playbook rather than with a post-build copy step means
the files follow Antora's configured output directory (including
--to-dir), are included by hack/local-build.sh, and are not affected by
extra arguments passed to `npm run build`. The build fails if either
file is missing, so the site cannot be published without them.

Fixes konflux-ci#665

Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
@NopeCharon
NopeCharon requested a review from a team as a code owner November 10, 2026 07:36

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include Apache 2.0 LICENSE in published documentation artifacts

1 participant