Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #11729: Automate update of releasenotes.xml by content for new … #11750

Merged
merged 1 commit into from Jun 26, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci/jsoref-spellchecker/whitelist.words
Expand Up @@ -478,6 +478,7 @@ Foreach
Fpuppycrawl
fq
freedomsponsors
freemarker
Fregexp
Fresources
Frob
Expand Down
57 changes: 57 additions & 0 deletions .ci/releasenotes-gen-xdoc-push.sh
@@ -0,0 +1,57 @@
#!/bin/bash
set -e

source ./.ci/util.sh

checkForVariable() {
VAR_NAME=$1
if [ -v "${!VAR_NAME}" ]; then
echo "Error: Define $1 environment variable"
exit 1
fi
}

checkForVariable "READ_ONLY_TOKEN"

checkout_from https://github.com/checkstyle/contribution

cd .ci-temp/contribution/releasenotes-builder
mvn -e --no-transfer-progress clean compile package
cd ../../../

if [ -d .ci-temp/checkstyle ]; then
cd .ci-temp/checkstyle/
git reset --hard origin/master
git pull origin master
git fetch --tags
cd ../../
else
cd .ci-temp/
git clone https://github.com/checkstyle/checkstyle
cd ../
fi

CS_RELEASE_VERSION="$(getCheckstylePomVersion)"
echo CS_RELEASE_VERSION="$CS_RELEASE_VERSION"

cd .ci-temp/checkstyle
LATEST_RELEASE_TAG=$(curl -s https://api.github.com/repos/checkstyle/checkstyle/releases/latest \
| jq ".tag_name")
echo LATEST_RELEASE_TAG="$LATEST_RELEASE_TAG"

cd ../

BUILDER_RESOURCE_DIR="contribution/releasenotes-builder/src/main/resources/com/github/checkstyle"

java -jar contribution/releasenotes-builder/target/releasenotes-builder-1.0-all.jar \
-localRepoPath checkstyle \
-remoteRepoPath checkstyle/checkstyle \
-startRef "$LATEST_RELEASE_TAG" \
-releaseNumber "$CS_RELEASE_VERSION" \
-githubAuthToken "$READ_ONLY_TOKEN" \
romani marked this conversation as resolved.
Show resolved Hide resolved
-generateXdoc \
-xdocTemplate $BUILDER_RESOURCE_DIR/templates/xdoc_freemarker.template \
-publishXdoc -publishXdocWithPush

echo "releasenotes.xml after commit:"
head "checkstyle/src/xdocs/releasenotes.xml" -n 100