Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

github:
description: Parent project internally used in Maven-based projects of the Apache Logging Services
homepage: https://logging.apache.org/logging-parent/latest
homepage: https://logging.apache.org/logging-parent
labels:
- apache
- java
Expand Down
2 changes: 1 addition & 1 deletion .github/generate-email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ PROJECT_VERSION="$2"
COMMIT_ID="$3"

# Check release notes file
RELEASE_NOTES_FILE="$SCRIPT_DIR/../src/site/_release-notes/_$PROJECT_VERSION.adoc"
RELEASE_NOTES_FILE="$SCRIPT_DIR/../target/generated-site/antora/modules/ROOT/pages/_release-notes/$PROJECT_VERSION.adoc"
[ -f "$RELEASE_NOTES_FILE" ] || {
stderr "Couldn't find release notes file: $RELEASE_NOTES_FILE"
exit 1
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/build-reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,34 @@ jobs:
-DinstallAtEnd=true \
clean install

# Node.js cache is needed for Antora
- name: Set up Node.js cache
if: inputs.site-enabled
id: nodejs-cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # 4.0.2
with:
# We should be calculating the cache key using `package-lock.json` instead!
# See https://stackoverflow.com/a/48524475/1278899
# For that, `package-lock.json` needs to be committed into the repository – right now it is `.gitignore`d.
# Once it is there, we should ideally switch from `npm i` to `npm ci`.
# For that, we need to configure `dependabot` to update hundreds of dependencies listed in `package-lock.json`.
# That translates to a never ending rain of `dependabot` PRs.
# I doubt if the wasted CPU cycles worth the gain.
key: ${{ runner.os }}-nodejs-cache-${{ hashFiles('node', 'node_modules') }}
# `actions/cache` doesn't recommend caching `node_modules`.
# Though none of its recipes fit our bill, since we install Node.js using `frontend-maven-plugin`.
# See https://github.com/actions/cache/blob/main/examples.md#node---npm
# We settle for this quick-n-dirty solution for the time being.
path: |
node
node_modules

- name: Build the website
if: inputs.site-enabled
shell: bash
env:
# Making Node.js cache hit visible for debugging purposes
NODEJS_CACHE_HIT: ${{ steps.nodejs-cache.outputs.cache-hit }}
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ jobs:
contents: write
with:
project-id: logging-parent
site-enabled: true
51 changes: 31 additions & 20 deletions .github/workflows/deploy-release-reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ on:
description: Identifier used in the distribution artifact and Subversion repository folder filenames (e.g., `logging-parent`)
required: true
type: string
site-enabled:
description: Flag indicating if a website should be generated prior to deployment using `./mvnw site`
default: false
type: boolean
distribution-attachment-filepath-pattern:
description: The regex pattern matched against the full filepath for determining attachments to be included in the distribution
default: ""
Expand Down Expand Up @@ -139,18 +135,38 @@ jobs:
./mvnw \
--non-recursive --batch-mode --errors --no-transfer-progress \
-P changelog-release
./mvnw \
--non-recursive --batch-mode --errors --no-transfer-progress \
process-sources
git add src
if [ -n "$(git status --porcelain)" ]; then
git commit -S src -m "Release changelog for version \`$PROJECT_VERSION\`"
git push -f origin
fi

# Node.js cache is needed for Antora
- name: Set up Node.js cache
id: nodejs-cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # 4.0.2
with:
# We should be calculating the cache key using `package-lock.json` instead!
# See https://stackoverflow.com/a/48524475/1278899
# For that, `package-lock.json` needs to be committed into the repository – right now it is `.gitignore`d.
# Once it is there, we should ideally switch from `npm i` to `npm ci`.
# For that, we need to configure `dependabot` to update hundreds of dependencies listed in `package-lock.json`.
# That translates to a never ending rain of `dependabot` PRs.
# I doubt if the wasted CPU cycles worth the gain.
key: ${{ runner.os }}-nodejs-cache-${{ hashFiles('node', 'node_modules') }}
# `actions/cache` doesn't recommend caching `node_modules`.
# Though none of its recipes fit our bill, since we install Node.js using `frontend-maven-plugin`.
# See https://github.com/actions/cache/blob/main/examples.md#node---npm
# We settle for this quick-n-dirty solution for the time being.
path: |
node
node_modules

- name: Build the website
if: inputs.site-enabled
shell: bash
env:
# Making Node.js cache hit visible for debugging purposes
NODEJS_CACHE_HIT: ${{ steps.nodejs-cache.outputs.cache-hit }}
run: |
export TIMESTAMP=$(./mvnw \
--non-recursive --quiet --batch-mode \
Expand Down Expand Up @@ -264,18 +280,16 @@ jobs:
# Checkout the SVN repository
export SVN_DIR="/tmp/svn-repo"
svn co \
--depth files \
"https://dist.apache.org/repos/dist/dev/logging" \
"https://dist.apache.org/repos/dist/dev/logging/$PROJECT_ID" \
"$SVN_DIR"
cd "$SVN_DIR"
svn up --depth files "$PROJECT_ID"

# Switch to the distribution folder
if [[ \! -d "$PROJECT_ID" || \! -d "$PROJECT_ID/$PROJECT_VERSION" ]]; then
mkdir -p "$PROJECT_ID/$PROJECT_VERSION"
svn add --force "$PROJECT_ID"
fi
cd "$PROJECT_ID/$PROJECT_VERSION"
[ -d "$PROJECT_VERSION" ] || {
mkdir "$PROJECT_VERSION"
svn add "$PROJECT_VERSION"
}
cd "$PROJECT_VERSION"

# Clean up old files
find . -name "${DIST_FILENAME_PREFIX}*" -type f -print0 | xargs -0 -r svn delete
Expand All @@ -287,9 +301,7 @@ jobs:
done

# Copy the site
if [ "$SITE_ENABLED" == "true" ]; then
cp "$GITHUB_WORKSPACE/target/site.zip" "${DIST_FILENAME_VERSIONED_PREFIX}-site.zip"
fi
cp "$GITHUB_WORKSPACE/target/site.zip" "${DIST_FILENAME_VERSIONED_PREFIX}-site.zip"

# Copy the distribution
cp "$DIST_FILEPATH_PREFIX"* .
Expand All @@ -305,4 +317,3 @@ jobs:
PROJECT_ID: ${{ inputs.project-id }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SITE_ENABLED: ${{ inputs.site-enabled }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ target/
.project
.classpath
.settings/
# Node.js
node
node_modules
package-lock.json
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache Log4j Parent
Copyright 2022-2023 The Apache Software Foundation
Copyright 2022-2024 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ https://search.maven.org/search?q=g:org.apache.logging%20a:logging-parent[image:
https://www.apache.org/licenses/LICENSE-2.0.txt[image:https://img.shields.io/github/license/apache/logging-parent.svg[License]]

Parent project **internally** used in Maven-based projects of https://logging.apache.org[the Apache Logging Services] projects.
See https://logging.apache.org/logging-parent/latest[the project website] for further information.
See https://logging.apache.org/logging-parent[the project website] for further information.
117 changes: 117 additions & 0 deletions antora-playbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

site:
title: Apache Logging Parent
url: "https://logging.apache.org/logging-parent"
start_page: "ROOT::index.adoc"

content:
sources:
- url: .
branches: HEAD
start_paths:
- target/generated-site/antora
edit_url:

asciidoc:
extensions:
- "@asciidoctor/tabs"

ui:

bundle:
url: "https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable"
snapshot: true

# Template files: https://github.com/asciidoctor/asciidoctor-docs-ui/blob/main/src
# Template variables: https://docs.antora.org/antora-ui-default/templates
supplemental_files:

# Add `@asciidoctor/tabs` extension styles
- path: css/vendor/tabs.css
contents: ./node_modules/@asciidoctor/tabs/dist/css/tabs.css

# Add `@asciidoctor/tabs` extension scripts
- path: js/vendor/tabs.js
contents: ./node_modules/@asciidoctor/tabs/dist/js/tabs.js

- path: partials/footer-scripts.hbs
contents: |
<script id="site-script" src="{{{uiRootPath}}}/js/site.js" data-ui-root-path="{{{uiRootPath}}}"></script>
<script async src="{{{uiRootPath}}}/js/vendor/highlight.js"></script>
<!-- `@asciidoctor/tabs` extension scripts -->
<script async src="{{{uiRootPath}}}/js/vendor/tabs.js"></script>
{{#if env.SITE_SEARCH_PROVIDER}}
{{> search-scripts}}
{{/if}}

- path: partials/head-styles.hbs
contents: |
<link rel="stylesheet" href="{{{uiRootPath}}}/css/site.css">
<link rel="icon" href="{{{uiRootPath}}}/../_images/favicon.ico" type="image/x-icon">
<!-- `@asciidoctor/tabs` extension styles -->
<link rel="stylesheet" href="{{{uiRootPath}}}/css/vendor/tabs.css">
<style>
/* `page-toclevels` greater than 4 are not supported by Antora UI, patching it: */
.toc .toc-menu li[data-level="4"] a {
padding-left: 2.75rem
}
/* Replace the default highlight.js color for strings from red to green: */
.hljs-string {
color: #0f8532;
}
</style>

- path: partials/header-content.hbs
contents: |
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<span class="navbar-item title">{{site.title}}</span>
</div>
<div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="https://logging.apache.org">a subproject of&nbsp;<strong>Apache Logging Services</strong></a>
</div>
</div>
</nav>
</header>

- path: partials/footer-content.hbs
contents: |
<footer class="footer">
<p>
Copyright © 1999-{{{year}}} <a href="https://www.apache.org/">The Apache Software Foundation</a>.
Licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache Software License, Version 2.0</a>.
Please read our <a href="https://privacy.apache.org/policies/privacy-policy-public.html">privacy policy</a>.
</p>
<p>
Apache, Log4j, and the Apache feather logo are trademarks or registered trademarks of The Apache Software Foundation.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.
</p>
</footer>

# Disable component version selector
- path: partials/nav-explore.hbs
contents: ""

# Fix the `Edit this page` link
- path: partials/edit-this-page.hbs
contents: |
<div class="edit-this-page"><a href="https://github.com/apache/logging-parent/edit/main/src/site/antora/modules/{{page.module}}/pages/{{page.relativeSrcPath}}">Edit this Page</a></div>
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dependencies": {
"@antora/cli": "^3.2.0-alpha.4",
"@antora/site-generator-default": "^3.2.0-alpha.4",
"@asciidoctor/tabs": "^1.0.0-beta.6"
}
}
Loading