You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2023/09/06 09:25:31 UTC
[logging-parent] 02/02: Automate `revision` update and changelog release
This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch release/10.0.0
in repository https://gitbox.apache.org/repos/asf/logging-parent.git
commit 575212baf9e5dcd85a4f5d1e3c33f27d50a86e5a
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Wed Sep 6 11:24:08 2023 +0200
Automate `revision` update and changelog release
---
.github/workflows/build.yml | 3 ++
.github/workflows/deploy-release-reusable.yml | 42 +++++++++++++++++++---
RELEASING.adoc | 37 ++++++++++---------
pom.xml | 2 +-
.../add-changelog-export-profile.xml | 0
.../add-changelog-release-profile.xml | 0
.../{10.0.0 => .10.x.x}/add-deploy-profile.xml | 0
.../add-distribution-profile.xml | 0
.../add-release-instructions.xml | 0
.../{10.0.0 => .10.x.x}/add-release-profile.xml | 0
.../add-reusable-build-workflow.xml | 0
.../{10.0.0 => .10.x.x}/use-changelog-plugin.xml | 0
src/changelog/{10.0.0 => .10.x.x}/use-semver.xml | 0
src/changelog/10.0.0/.release-notes.md.ftl | 27 --------------
src/changelog/10.0.0/.release.xml | 21 -----------
15 files changed, 62 insertions(+), 70 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 27f65e8..c3d2b05 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -55,6 +55,9 @@ jobs:
if: github.repository == 'apache/logging-parent' && startsWith(github.ref, 'refs/heads/release/')
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yml@main
secrets: inherit
+ # Write permissions to allow the Maven `revision` property update, changelog release, etc.
+ permissions:
+ contents: write
with:
project-name: logging-parent
distribution-attachment-count: 0
diff --git a/.github/workflows/deploy-release-reusable.yml b/.github/workflows/deploy-release-reusable.yml
index 496ac90..cb4b080 100644
--- a/.github/workflows/deploy-release-reusable.yml
+++ b/.github/workflows/deploy-release-reusable.yml
@@ -78,12 +78,45 @@ jobs:
- name: Export version
run: |
- export PROJECT_VERSION=$(./mvnw \
- --quiet --batch-mode -DforceStdout=true \
- -Dexpression=project.version \
+ [[ "$GIT_REF" =~ ^refs/heads/release/.+$ ]] || {
+ echo "was expecting a \`refs/heads/release/\`-prefixed Git reference, found: \`$GIT_REF\`"
+ exit 1
+ }
+ export PROJECT_VERSION=$(echo "$GIT_REF | sed 's/^refs\/heads\/release\///')
+ echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
+ env:
+ GIT_REF: ${{ github.ref }}
+
+ - name: Set the Maven `revision` property
+ run: |
+ set -x
+ export REVISION=$(./mvnw \
+ --non-recursive --quiet --batch-mode
+ -DforceStdout=true \
+ -Dexpression=revision \
help:evaluate \
| tail -n 1)
- echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
+ if [ "$REVISION" != "$PROJECT_VERSION" ]; then
+ echo "Maven \`revision\` property \`$REVISION\` doesn't match with the project version \`$PROJECT_VERSION\`, updating \`pom.xml\`..."
+ ./mvnw \
+ --non-recursive --batch-mode --errors --no-transfer-progress \
+ -Dproperty=revision \
+ -DnewVersion="$PROJECT_VERSION" \
+ -DgenerateBackupPoms=false \
+ versions:set-property
+ git commit pom.xml -m "Set version to \`$PROJECT_VERSION\`"
+ fi
+
+ - name: Release changelog
+ run: |
+ set -x
+ ./mvnw \
+ --non-recursive --batch-mode --errors --no-transfer-progress \
+ -P changelog-release
+ git add src/changelog
+ if [ -n "$(git status --porcelain)" ]; then
+ git commit src/changelog -m "Release changelog for version \`$PROJECT_VERSION\`"
+ fi
- name: Upload to Nexus
run: |
@@ -99,7 +132,6 @@ jobs:
SIGN_KEY: ${{ secrets.GPG_SECRET_KEY }}
- name: Create the distribution
- if: startsWith(github.ref, 'refs/heads/release/')
run: |
# Generate the distribution (i.e., `src.zip` and optional `bin.zip`)
diff --git a/RELEASING.adoc b/RELEASING.adoc
index c29ea8e..bc2e05b 100644
--- a/RELEASING.adoc
+++ b/RELEASING.adoc
@@ -43,20 +43,29 @@ In the code examples below, assuming the version to be released is `7.8.0`.
== Stage the release
-. Checkout the release branch: `git checkout -B release/7.8.0 origin/main`
-. Perform and commit following changes:
-.. Set the `revision` property to `7.8.0` in xref:pom.xml[`pom.xml`]
-.. For release notes
-... Run `./mvnw -N -P changelog-release` and verify `src/changelog` content (e.g., `.release-notes.md.ftl`)
-... Run `./mvnw -N -P changelog-export` and verify `target/release-notes` content
-. Make sure that `./mvnw clean verify` succeeds – if not, implement necessary fixes
-. Commit and push the `release/7.8.0` branch
-. Make sure the associated https://github.com/apache/{repository-name}/actions[GitHub Actions workflow] succeeds:
+. Create and push the release branch:
++
+[source,bash]
+----
+git fetch -p
+git checkout -B release/7.8.0 origin/main
+git push origin release/7.8.0
+----
+. Verify that the associated https://github.com/apache/{repository-name}/actions[GitHub Actions workflow] succeeds:
+.. `revision` property in `pom.xml` is updated
+.. Changelog is released (i.e., `src/changelog/7.8.0` folder is populated)
.. *Signed artifacts* are uploaded to the _Staging Repositories_ in https://repository.apache.org/[repository.apache.org]
-.. *Signed distribution and its checksum* (e.g., `apache-{project-name}-7.8.0.{zip,.zip.asc,.zip.sha512}`) are uploaded to https://dist.apache.org/repos/dist/dev/logging/log4j[dist.apache.org/repos/dist/**dev**/logging/log4j] Subversion repository (along with auxiliary files; email texts, etc.)
+.. *Signed distribution and its checksum* (e.g., `apache-{project-name}-7.8.0-{bin,src}.{zip,.zip.asc,.zip.sha512}`) are uploaded to https://dist.apache.org/repos/dist/dev/logging/log4j[dist.apache.org/repos/dist/**dev**/logging/log4j] Subversion repository (along with auxiliary files; email texts, etc.)
+
If not, commit necessary fixes, push, and repeat.
+
++
+[TIP]
+====
+GitHub Actions workflow is idempotent.
+You can iterate on the `release/7.8.0` branch to perfect it.
+====
. _Close_ the repository in https://repository.apache.org/[repository.apache.org]
== Vote the release
@@ -65,7 +74,8 @@ If not, commit necessary fixes, push, and repeat.
+
[WARNING]
====
-Double-check the cited https://repository.apache.org[repository.apache.org] URL in the generated email, it might have changed!
+**Fix the cited https://repository.apache.org[repository.apache.org] URL** in the generated email!
+It changes after every Nexus deployment.
====
+
[WARNING]
@@ -128,11 +138,6 @@ Once the artifacts are visible in https://central.sonatype.dev/[central.sonatype
+
[WARNING]
====
-Double-check the cited https://repository.apache.org[repository.apache.org] URL in the generated email, it might have changed!
-====
-+
-[WARNING]
-====
Make sure your email is sent in plain text, that is, https://infra.apache.org/contrib-email-tips#nohtml[no HTML]!
If you are using GMail, simply enable the _"Plain text mode"_ while composing your message.
====
diff --git a/pom.xml b/pom.xml
index 0d67fe4..abab6d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,7 +80,7 @@
<properties>
<!-- project version -->
- <revision>10.0.0</revision>
+ <revision>10.0.0-SNAPSHOT</revision>
<!-- `minimalJavaBuildVersion` is employed by `org.apache:apache`, which is the parent of us.
`minimalJavaBuildVersion` is used for enforcing the compiler version.
diff --git a/src/changelog/10.0.0/add-changelog-export-profile.xml b/src/changelog/.10.x.x/add-changelog-export-profile.xml
similarity index 100%
rename from src/changelog/10.0.0/add-changelog-export-profile.xml
rename to src/changelog/.10.x.x/add-changelog-export-profile.xml
diff --git a/src/changelog/10.0.0/add-changelog-release-profile.xml b/src/changelog/.10.x.x/add-changelog-release-profile.xml
similarity index 100%
rename from src/changelog/10.0.0/add-changelog-release-profile.xml
rename to src/changelog/.10.x.x/add-changelog-release-profile.xml
diff --git a/src/changelog/10.0.0/add-deploy-profile.xml b/src/changelog/.10.x.x/add-deploy-profile.xml
similarity index 100%
rename from src/changelog/10.0.0/add-deploy-profile.xml
rename to src/changelog/.10.x.x/add-deploy-profile.xml
diff --git a/src/changelog/10.0.0/add-distribution-profile.xml b/src/changelog/.10.x.x/add-distribution-profile.xml
similarity index 100%
rename from src/changelog/10.0.0/add-distribution-profile.xml
rename to src/changelog/.10.x.x/add-distribution-profile.xml
diff --git a/src/changelog/10.0.0/add-release-instructions.xml b/src/changelog/.10.x.x/add-release-instructions.xml
similarity index 100%
rename from src/changelog/10.0.0/add-release-instructions.xml
rename to src/changelog/.10.x.x/add-release-instructions.xml
diff --git a/src/changelog/10.0.0/add-release-profile.xml b/src/changelog/.10.x.x/add-release-profile.xml
similarity index 100%
rename from src/changelog/10.0.0/add-release-profile.xml
rename to src/changelog/.10.x.x/add-release-profile.xml
diff --git a/src/changelog/10.0.0/add-reusable-build-workflow.xml b/src/changelog/.10.x.x/add-reusable-build-workflow.xml
similarity index 100%
rename from src/changelog/10.0.0/add-reusable-build-workflow.xml
rename to src/changelog/.10.x.x/add-reusable-build-workflow.xml
diff --git a/src/changelog/10.0.0/use-changelog-plugin.xml b/src/changelog/.10.x.x/use-changelog-plugin.xml
similarity index 100%
rename from src/changelog/10.0.0/use-changelog-plugin.xml
rename to src/changelog/.10.x.x/use-changelog-plugin.xml
diff --git a/src/changelog/10.0.0/use-semver.xml b/src/changelog/.10.x.x/use-semver.xml
similarity index 100%
rename from src/changelog/10.0.0/use-semver.xml
rename to src/changelog/.10.x.x/use-semver.xml
diff --git a/src/changelog/10.0.0/.release-notes.md.ftl b/src/changelog/10.0.0/.release-notes.md.ftl
deleted file mode 100644
index 7a809a3..0000000
--- a/src/changelog/10.0.0/.release-notes.md.ftl
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- ~ 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.
- -->
-
-# ${release.version}<#if release.date?has_content> (${release.date})</#if>
-
-This minor release contains various improvements that we expect to relieve the load on `pom.xml` and GitHub Actions workflows of Maven-based projects we parent.
-This is of particular importance while managing and cutting releases from multiple repositories.
-See `README.adoc` for the complete list of features and their usage.
-
-See [this `logging-log4j-tools` GitHub Actions workflow run](https://github.com/apache/logging-log4j-tools/actions/runs/6070379396) demonstrating a successful release cut using a SNAPSHOT version of this `logging-parent` release.
-All preparations (release notes, distribution ZIP, vote & announcement emails, etc.) are staged to both Nexus and SVN and waiting the release manager to proceed.
-
-<#include "../.changelog.md.ftl">
diff --git a/src/changelog/10.0.0/.release.xml b/src/changelog/10.0.0/.release.xml
deleted file mode 100644
index fbc8331..0000000
--- a/src/changelog/10.0.0/.release.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-<release xmlns="http://logging.apache.org/log4j/changelog"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.0.xsd"
- date="2023-09-06" version="10.0.0"/>