Skip to content

Commit

Permalink
Fix generate e-mail script
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed Sep 17, 2024
1 parent 392ae5b commit 4bdd457
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions .github/generate-email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ fail_for_invalid_args() {
# Constants
PROJECT_NAME="Apache Logging Parent"
PROJECT_ID="logging-parent"
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/$PROJECT_ID"
PROJECT_VERSION="$2"
COMMIT_ID="$3"
PROJECT_DIST_URL="https://dist.apache.org/repos/dist/dev/logging/$PROJECT_ID/$PROJECT_VERSION"

Expand All @@ -52,21 +52,10 @@ RELEASE_NOTES_FILE="$SCRIPT_DIR/../target/generated-site/antora/modules/ROOT/pag
exit 1
}

dump_review_kit() {
cat "$SCRIPT_DIR/release-review-kit.txt" \
| sed -n '/-----8<-----~( cut here )~-----8<-----/,$p' \
| tail -n +2 \
| sed -e "s|^| |g
s|@PROJECT_ID@|$PROJECT_ID|g
s|@PROJECT_VERSION@|$PROJECT_VERSION|g
s|@PROJECT_DIST_URL@|$PROJECT_DIST_URL|g
s|@COMMIT_ID@|${COMMIT_ID:0:8}|g"
}

dump_release_notes() {
awk "f{print} /^Release date::/{f=1}" "$RELEASE_NOTES_FILE" \
| sed -r -e 's|'$PROJECT_REPO'/(issues|pull)/[0-9]+\[([0-9]+)\]|#\2|g
s|https://github.com/([^/]+)/([^/]+)/(pull|issues)/([0-9]+)\[(\1/\2#\4)\]|\5|g'
| sed -r -e 's!'$PROJECT_REPO'/(issues|pull)/[0-9]+\[([0-9]+)\]!#\2!g
s!https://github.com/([^/]+)/([^/]+)/(pull|issues)/([0-9]+)\[(\1/\2#\4)\]!\5!g'
}

case $1 in
Expand All @@ -84,7 +73,7 @@ Commit: $COMMIT_ID
Distribution: $PROJECT_DIST_URL
Nexus: https://repository.apache.org/content/repositories/orgapachelogging-<FIXME>
Signing key: 0x077e8893a6dcc33dd4a4d5b256e73ba9a0b592d0
Review kit: https://s.apache.org/logging-parent-release-review-kit
Review kit: https://logging.apache.org/logging-parent/release-review-instructions.html
Please download, test, and cast your votes on this mailing list.
Expand All @@ -94,12 +83,12 @@ Please download, test, and cast your votes on this mailing list.
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.
votes are officially counted. At least 3 +1 votes and more
positive than negative votes are required.
== Release notes
$(dump_release_notes)
== Release Notes
EOF
dump_release_notes
;;

announce)
Expand Down

0 comments on commit 4bdd457

Please sign in to comment.