Repository navigation
build: publish LICENSE and NOTICE with the generated site - #671
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
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>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repository is licensed under Apache 2.0 since #664, but the build and deployment workflows publish only Antora's
publicoutput. As a result, the production site, the Netlify previews, and the downloadablewebsiteartifact don't include a copy of the license. Apache 2.0 §4(a) and §4(d) require that recipients get the license and theNOTICEfile.This PR adds a small Antora extension (
antora-extensions/publish-license-files.js), registered inantora-playbook.yml. Before publishing, it readsLICENSEandNOTICEfrom the playbook directory and adds them to the site catalog, so both end up at the root of the generated site (for examplehttps://konflux-ci.dev/docs/LICENSE).I did this in the playbook instead of adding a
cpstep to thebuildscript because:--to-dirhack/local-build.shand plainnpx antorabuilds include them toonpm run buildwould receive any extra arguments passed withnpm run build -- ...and breakIf 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/LICENSEandpublic/NOTICEare created and are byte-identical to the repository files. The sitemap and the search index are unchanged, andnpm run generate-llms-txtstill works.npx antora generate --to-dir <dir> antora-playbook.yml: both files are written to the custom output directory.NOTICEtemporarily removed, the build fails with anENOENTerror naming the missing file.Fixes #665