Skip to content

Commit

Permalink
Update logging-parent to version 11.0.0 and migrate to Antora (ap…
Browse files Browse the repository at this point in the history
  • Loading branch information
vy committed Apr 19, 2024
1 parent 26ef196 commit cce5e3e
Show file tree
Hide file tree
Showing 82 changed files with 593 additions and 1,440 deletions.
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
github:

description: "Tools internally used by the Apache Log4j project"
homepage: https://logging.apache.org/log4j/2.x/
homepage: https://logging.apache.org/log4j/tools
labels:
- apache
- java
Expand Down
8 changes: 6 additions & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

version: 2

# Add Maven Central explicitly to work around:
# https://github.com/dependabot/dependabot-core/issues/8329
# Fix the Maven Central to the ASF repository to work around: https://github.com/dependabot/dependabot-core/issues/8329
registries:
maven-central:
type: maven-repository
Expand All @@ -45,3 +44,8 @@ updates:
directory: "/"
schedule:
interval: weekly

- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
15 changes: 7 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,32 @@ jobs:

build:
if: github.actor != 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/10.6.0
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.0.0
with:
site-enabled: true

deploy-snapshot:
needs: build
if: github.repository == 'apache/logging-log4j-tools' && github.ref_name == 'main'
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/10.6.0
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/11.0.0
# Secrets for deployments
secrets:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PW: ${{ secrets.NEXUS_PW }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PW }}

deploy-release:
needs: build
if: github.repository == 'apache/logging-log4j-tools' && startsWith(github.ref_name, 'release/')
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/10.6.0
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/11.0.0
# Secrets for deployments
secrets:
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
LOGGING_STAGE_DEPLOYER_USER: ${{ secrets.LOGGING_STAGE_DEPLOYER_USER }}
LOGGING_STAGE_DEPLOYER_PW: ${{ secrets.LOGGING_STAGE_DEPLOYER_PW }}
NEXUS_USERNAME: ${{ secrets.LOGGING_STAGE_DEPLOYER_USER }}
NEXUS_PASSWORD: ${{ secrets.LOGGING_STAGE_DEPLOYER_PW }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
# Write permissions to allow the Maven `revision` property update, changelog release, etc.
permissions:
contents: write
with:
project-id: log4j-tools
site-enabled: true
95 changes: 95 additions & 0 deletions .github/workflows/deploy-site.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#
# 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.
#

name: deploy-site

on:
push:
branches:
- "main"
- "main-site-pro"
- "release/*"
paths-ignore:
- "**.md"
- "**.txt"

permissions: read-all

jobs:

deploy-site-stg:
if: github.repository == 'apache/logging-log4j-tools' && github.ref_name == 'main'
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.0.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
# Write permissions for committing the generated site
permissions:
contents: write
with:
asf-yaml-content: |
staging:
profile: ~
whoami: ${{ github.ref_name }}-site-stg-out
subdir: content/log4j/tools
target-branch: ${{ github.ref_name }}-site-stg-out

deploy-site-pro:
if: github.repository == 'apache/logging-log4j-tools' && github.ref_name == 'main-site-pro'
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.0.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
# Write permissions for committing the generated site
permissions:
contents: write
with:
asf-yaml-content: |
publish:
profile: ~
whoami: ${{ github.ref_name }}-out
subdir: content/log4j/tools
target-branch: ${{ github.ref_name }}-out

export-version:
if: github.repository == 'apache/logging-log4j-tools' && startsWith(github.ref_name, 'release/')
runs-on: ubuntu-latest
outputs:
version: ${{ steps.export-version.outputs.version }}
steps:
- name: Export version
id: export-version
run: |
version=$(echo "${{ github.ref_name }}" | sed 's/^release\///')
echo "version=$version" >> "$GITHUB_OUTPUT"
deploy-site-rel:
needs: export-version
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/11.0.0
# Secrets for committing the generated site
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
# Write permissions for committing the generated site
permissions:
contents: write
with:
asf-yaml-content: |
staging:
profile: ~
whoami: ${{ github.ref_name }}-site-stg-out
subdir: content/log4j/tools-${{ needs.export-version.outputs.version }}
target-branch: ${{ github.ref_name }}-site-stg-out
4 changes: 2 additions & 2 deletions .github/workflows/merge-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:

build:
if: github.repository == 'apache/logging-log4j-tools' && github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/10.6.0
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.0.0

merge-dependabot:
needs: build
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/10.6.0
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/11.0.0
permissions:
contents: write # to push changelog commits
pull-requests: write # to close the PR
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ target/
.project
.classpath
.settings/
# Node
node
node_modules
package-lock.json
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 Log4j Tools
url: "https://logging.apache.org/log4j/kotlin"
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-log4j-kotlin/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"
}
}
2 changes: 1 addition & 1 deletion src/changelog/.0.x.x/.release-notes.adoc.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
////

[#release-notes-${release.version?replace("[^a-zA-Z0-9]", "-", "r")}]
=== ${release.version}
== ${release.version}

<#if release.date?has_content>Release date:: ${release.date}</#if>

Expand Down
8 changes: 8 additions & 0 deletions src/changelog/.0.x.x/antora.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="changed">
<issue id="apache/logging-log4j2#2443" link="https://github.com/apache/logging-log4j2/pull/2443"/>
<description format="asciidoc">Website is migrated to Antora</description>
</entry>
4 changes: 2 additions & 2 deletions src/changelog/.0.x.x/update_commons_io_commons_io.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://logging.apache.org/log4j/changelog"
xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.3.xsd"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="updated">
<issue id="114" link="https://github.com/apache/logging-log4j-tools/pull/114"/>
<description format="asciidoc">Update `commons-io:commons-io` to version `2.16.1`</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://logging.apache.org/log4j/changelog"
xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.3.xsd"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="updated">
<issue id="115" link="https://github.com/apache/logging-log4j-tools/pull/115"/>
<description format="asciidoc">Update `org.apache.logging:logging-parent` to version `11.0.0`</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://logging.apache.org/log4j/changelog"
xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.3.xsd"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="updated">
<issue id="113" link="https://github.com/apache/logging-log4j-tools/pull/113"/>
<description format="asciidoc">Update `org.apache.maven.plugin-tools:maven-plugin-annotations` to version `3.12.0`</description>
Expand Down
4 changes: 2 additions & 2 deletions src/changelog/.changelog.adoc.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<#list entriesByType as entryType, entries>

[#release-notes-${release.version?replace("[^a-zA-Z0-9]", "-", "r")}-${entryType?lower_case}]
==== ${entryType?capitalize}
=== ${entryType?capitalize}

<#list entries as entry>
* ${entry.description.text?replace("\\h+", " ", "r")}<#if entry.issues?has_content> (<#list entry.issues as issue>${issue.link}[${issue.id}]<#if issue?has_next>, </#if></#list>)</#if>
* ${entry.description.text?replace("\\s+", " ", "r")}<#if entry.issues?has_content> (<#list entry.issues as issue>${issue.link}[${issue.id}]<#if issue?has_next>, </#if></#list>)</#if>
</#list>
</#list>
</#if>
9 changes: 6 additions & 3 deletions src/changelog/.index.adoc.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@
3. Commit both `.index.adoc.ftl` and the generated `.index.adoc`
////

[#release-notes]
== Release Notes
// Release notes index does not look nice with a deep sectioning, override it:
:page-toclevels: 1

[#release-notes]
= Release notes
<#list releases as release><#if release.changelogEntryCount gt 0>
include::_release-notes/_${release.version}.adoc[]

include::_release-notes/${release.version}.adoc[]
</#if></#list>
2 changes: 1 addition & 1 deletion src/changelog/0.1.0/.release-notes.adoc.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
////

[#release-notes-${release.version?replace("[^a-zA-Z0-9]", "-", "r")}]
=== ${release.version}
== ${release.version}

<#if release.date?has_content>Release date:: ${release.date}</#if>

Expand Down
Loading

0 comments on commit cce5e3e

Please sign in to comment.