swebb2066 commented on code in PR #414:
URL: https://github.com/apache/logging-log4cxx/pull/414#discussion_r1797521246


##########
.github/generate-email.sh:
##########
@@ -0,0 +1,97 @@
+#!/bin/bash
+#
+# 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.
+#
+
+# Enable strict mode
+set -euo pipefail
+IFS=$'\n\t'
+
+stderr() {
+    echo "$*" 1>&2
+}
+
+fail_for_invalid_args() {
+    stderr "Invalid arguments!"
+    stderr "Expected arguments: <vote|announce> <version> <commitId>"
+    exit 1
+}
+
+# Check arguments
+[ $# -ne 3 ] && fail_for_invalid_args
+
+# Constants
+PROJECT_NAME="Apache Log4cxx"
+PROJECT_ID="log4cxx"
+PROJECT_VERSION="$2"
+PROJECT_SITE="https://logging.apache.org/$PROJECT_ID";
+PROJECT_STAGING_SITE="${PROJECT_SITE/apache.org/staged.apache.org}"
+PROJECT_REPO="https://github.com/apache/logging-log4cxx";
+COMMIT_ID="$3"
+PROJECT_DIST_URL="https://dist.apache.org/repos/dist/dev/logging/$PROJECT_ID/$PROJECT_VERSION";
+
+case $1 in
+
+vote)
+    cat <<EOF
+To: [email protected]
+Title: [VOTE] Release $PROJECT_NAME \`$PROJECT_VERSION\`
+
+This is a vote to release the $PROJECT_NAME \`$PROJECT_VERSION\`.
+
+Website: $PROJECT_STAGING_SITE/$PROJECT_VERSION/index.html
+GitHub: $PROJECT_REPO
+Commit: $COMMIT_ID
+Distribution: $PROJECT_DIST_URL
+Signing key: 0x077e8893a6dcc33dd4a4d5b256e73ba9a0b592d0
+Review kit: 
https://logging.apache.org/logging-parent/release-review-instructions.html

Review Comment:
   The reviewer should confirm the uploaded source code is not corrupt and
   is identical to the package generated by the Github action.
   
   This is what I have put in [the review kit I 
created](https://github.com/apache/logging-log4cxx/blob/master/admin/release-review-instructions.md)
   
   



##########
.github/workflows/package_code.yml:
##########
@@ -12,58 +13,180 @@
 # 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: Generate release files
 
 on:
   workflow_dispatch:
+    inputs:
+      project-version:
+        description: The version of Log4cxx
+        default: 1.3.0

Review Comment:
   Add 
   release-candidate:
     description: The tag suffix (a number) appended to 
"v${{project-version}}-RC"
     required: true
   
   Rational: Preparing a release begins with the assignment of a tag. (e.g. I 
have already assigned v1.3.0-RC1 )



##########
.github/workflows/package_code.yml:
##########
@@ -12,58 +13,180 @@
 # 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: Generate release files
 
 on:
   workflow_dispatch:

Review Comment:
   I see that [running an action on tag 
assignment](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#create)
 is possible.
   
   We could perform this action GITHUB_REF matches 
v[[:digit:]].[[:digit:]].[[:digit:]]-RC[[:digit:]]



##########
.github/generate-email.sh:
##########
@@ -0,0 +1,97 @@
+#!/bin/bash
+#
+# 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.
+#
+
+# Enable strict mode
+set -euo pipefail
+IFS=$'\n\t'
+
+stderr() {
+    echo "$*" 1>&2
+}
+
+fail_for_invalid_args() {
+    stderr "Invalid arguments!"
+    stderr "Expected arguments: <vote|announce> <version> <commitId>"
+    exit 1
+}
+
+# Check arguments
+[ $# -ne 3 ] && fail_for_invalid_args
+
+# Constants
+PROJECT_NAME="Apache Log4cxx"
+PROJECT_ID="log4cxx"
+PROJECT_VERSION="$2"
+PROJECT_SITE="https://logging.apache.org/$PROJECT_ID";
+PROJECT_STAGING_SITE="${PROJECT_SITE/apache.org/staged.apache.org}"
+PROJECT_REPO="https://github.com/apache/logging-log4cxx";
+COMMIT_ID="$3"
+PROJECT_DIST_URL="https://dist.apache.org/repos/dist/dev/logging/$PROJECT_ID/$PROJECT_VERSION";
+
+case $1 in
+
+vote)
+    cat <<EOF
+To: [email protected]
+Title: [VOTE] Release $PROJECT_NAME \`$PROJECT_VERSION\`
+
+This is a vote to release the $PROJECT_NAME \`$PROJECT_VERSION\`.
+
+Website: $PROJECT_STAGING_SITE/$PROJECT_VERSION/index.html
+GitHub: $PROJECT_REPO
+Commit: $COMMIT_ID
+Distribution: $PROJECT_DIST_URL
+Signing key: 0x077e8893a6dcc33dd4a4d5b256e73ba9a0b592d0
+Review kit: 
https://logging.apache.org/logging-parent/release-review-instructions.html
+
+Please download, test, and cast your votes on this mailing list.
+
+[ ] +1, release the artifacts
+[ ] -1, don't release, because...
+
+This vote is open for 72 hours and will pass unless getting a
+net negative vote count. All votes are welcome and we encourage
+everyone to test the release, but only the Logging Services PMC
+votes are officially counted. At least 3 +1 votes and more
+positive than negative votes are required.
+
+== Release Notes
+EOF
+    ;;
+
+announce)
+    cat <<EOF
+To: [email protected], [email protected]
+Title: [ANNOUNCE] $PROJECT_NAME \`$PROJECT_VERSION\` released
+
+${PROJECT_NAME} team is pleased to announce the \`$PROJECT_VERSION\`
+release. ${PROJECT_NAME} is a versatile, industrial-strength

Review Comment:
   "Apache ${PROJECT_NAME} is a logging framework for C++"



##########
.github/workflows/package_code.yml:
##########
@@ -12,58 +13,180 @@
 # 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: Generate release files
 
 on:
   workflow_dispatch:
+    inputs:
+      project-version:
+        description: The version of Log4cxx
+        default: 1.3.0
   push:
     branches:
       - master
-#  pull_request:
-#    branches:
-#      - master
+
+permissions: read-all
 
 jobs:
-  job1:
-    name: 'Package code for release'
-    runs-on: ubuntu-20.04
-    timeout-minutes: 38
+
+  package:
+    name: Package code
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871   # 
4.2.1
+        with:
+          persist-credentials: false # do not persist auth token in the local 
git config

Review Comment:
   Add ref: v${{project-version}}-RC${{release-candidate}
   
   Rational: Preparing a release begins with the assignment of a tag. (e.g. I 
have already assigned v1.3.0-RC1 )
   
   



##########
package.sh:
##########
@@ -0,0 +1,108 @@
+#!/bin/bash
+#
+set -e
+
+# Shorthand for digit class:
+d="[[:digit:]]"
+# Determine the version and build timestamp
+VERSION=$(sed -n -e "s/^set(log4cxx_VER \(.*\)\.$d\+)/\1/p" < 
src/cmake/projectVersionDetails.cmake)
+if ! echo "$VERSION" | grep -Eq "^$d+\.$d+\.$d+$"; then
+  echo Invalid version number: "$VERSION" >& 2
+  exit 1
+fi
+
+OUTPUT_TIMESTAMP=$(sed -n -e "s/^set(log4cxx_OUTPUT_TIMESTAMP 
\"\(.*\)\")/\1/p" < src/cmake/projectVersionDetails.cmake)

Review Comment:
   The date should be taken from the commit. This script could require a 
parameter or read it from a file in the build directory.



##########
src/cmake/projectVersionDetails.cmake:
##########
@@ -1,5 +1,27 @@
-# This file should contain nothing but the following line
-# setting the project version. The variable name must not
-# clash with the log4cxx_VERSION* variables automatically
+#
+# 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.
+#
+##
+# This file should contain only the current version and the build timestamp
+
+# The variable name must not clash with the log4cxx_VERSION* variables 
automatically
 # defined by the project() command.
 set(log4cxx_VER 1.3.0.0)
+
+# Timestamp used for the source archive to guarantee reproducible builds in 
ISO 8601 format.
+#
+# To generate use: date -u +%Y-%m-%dT%H:%M:%SZ

Review Comment:
   The date should be taken from the commit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to