2020-04-18 10:28:37 +02:00
|
|
|
#!/usr/bin/env bash
|
2023-11-16 12:53:38 +01:00
|
|
|
|
|
|
|
# abort the script on the first failing sub command
|
2018-10-28 16:55:48 +01:00
|
|
|
set -e
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2017-05-27 20:33:03 +02:00
|
|
|
# Make sure, everything is English...
|
2024-03-22 16:10:56 +01:00
|
|
|
export LANG=en_US.UTF-8
|
2017-05-27 20:33:03 +02:00
|
|
|
|
2015-09-18 11:25:30 +02:00
|
|
|
# verify the current directory
|
2021-04-18 19:25:28 +02:00
|
|
|
if [ ! -f pom.xml ] || [ ! -d ../pmd.github.io ]; then
|
2016-01-07 10:14:24 +01:00
|
|
|
echo "You seem to be in the wrong working directory or you don't have pmd.github.io checked out..."
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
|
|
|
echo "Expected:"
|
|
|
|
echo "* You are currently in the pmd repository"
|
|
|
|
echo "* ../pmd.github.io is the pmd.github.io repository"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-02-15 20:44:07 +01:00
|
|
|
#
|
|
|
|
# Make sure, we have ruby and bundler available
|
|
|
|
#
|
|
|
|
set +e # don't stop for error "command not found" - it is handled
|
|
|
|
ruby_version_full=$(ruby --version 2>&1)
|
|
|
|
ruby_version=$(echo "${ruby_version_full}" | grep "ruby 3" | head -1 2>&1)
|
|
|
|
if [ $? -eq 0 ] && [ -n "${ruby_version}" ]; then
|
|
|
|
echo "Using ${ruby_version_full}"
|
|
|
|
else
|
|
|
|
echo "Wrong ruby version! Expected ruby 3"
|
|
|
|
echo "${ruby_version_full}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
bundler_version=$(bundler --version 2>&1)
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo "Using ${bundler_version}"
|
|
|
|
else
|
|
|
|
echo "Missing bundler!"
|
|
|
|
echo "${bundler_version}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
# abort the script on the first failing sub command
|
|
|
|
set -e
|
|
|
|
|
2015-09-18 11:25:30 +02:00
|
|
|
CURRENT_BRANCH=
|
|
|
|
|
|
|
|
echo "-------------------------------------------"
|
|
|
|
echo "Releasing PMD"
|
|
|
|
echo "-------------------------------------------"
|
|
|
|
|
2023-03-02 16:45:31 +01:00
|
|
|
# allow to override the release version, e.g. via "RELEASE_VERSION=7.0.0-rc1 ./do-release.sh"
|
|
|
|
if [ "$RELEASE_VERSION" = "" ]; then
|
|
|
|
CURRENT_VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)
|
|
|
|
RELEASE_VERSION=${CURRENT_VERSION%-SNAPSHOT}
|
|
|
|
fi
|
|
|
|
|
2021-04-18 19:25:28 +02:00
|
|
|
MAJOR=$(echo "$RELEASE_VERSION" | cut -d . -f 1)
|
|
|
|
MINOR=$(echo "$RELEASE_VERSION" | cut -d . -f 2)
|
|
|
|
PATCH=$(echo "$RELEASE_VERSION" | cut -d . -f 3)
|
2017-07-01 18:56:33 +02:00
|
|
|
if [ "$PATCH" == "0" ]; then
|
2021-04-18 19:25:28 +02:00
|
|
|
NEXT_MINOR=$(("${MINOR}" + 1))
|
2017-07-01 18:56:33 +02:00
|
|
|
NEXT_PATCH="0"
|
2021-04-18 19:25:28 +02:00
|
|
|
LAST_MINOR=$(("${MINOR}" - 1))
|
2020-04-18 10:28:37 +02:00
|
|
|
LAST_PATCH="0"
|
2017-07-01 18:56:33 +02:00
|
|
|
else
|
|
|
|
# this is a bugfixing release
|
|
|
|
NEXT_MINOR="${MINOR}"
|
2021-04-18 19:25:28 +02:00
|
|
|
NEXT_PATCH=$(("${PATCH}" + 1))
|
2020-04-18 10:28:37 +02:00
|
|
|
LAST_MINOR="${MINOR}"
|
2021-04-18 19:25:28 +02:00
|
|
|
LAST_PATCH=$(("${PATCH}" - 1))
|
2017-07-01 18:56:33 +02:00
|
|
|
fi
|
2017-02-25 20:07:37 +01:00
|
|
|
|
2023-03-02 16:45:31 +01:00
|
|
|
# allow to override the next version, e.g. via "DEVELOPMENT_VERSION=7.0.0-SNAPSHOT ./do-release.sh"
|
|
|
|
if [ "$DEVELOPMENT_VERSION" = "" ]; then
|
|
|
|
DEVELOPMENT_VERSION="$MAJOR.$NEXT_MINOR.$NEXT_PATCH-SNAPSHOT"
|
2018-01-21 16:22:59 +01:00
|
|
|
fi
|
|
|
|
|
2023-03-02 16:45:31 +01:00
|
|
|
# allow to override the last version, e.g. via "LAST_VERSION=6.55.0 ./do-release.sh"
|
|
|
|
if [ "$LAST_VERSION" = "" ]; then
|
|
|
|
LAST_VERSION="$MAJOR.$LAST_MINOR.$LAST_PATCH"
|
|
|
|
fi
|
2018-01-21 16:22:59 +01:00
|
|
|
|
2017-02-25 20:07:37 +01:00
|
|
|
# http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
|
|
|
|
CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
|
|
|
|
CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
|
|
|
|
CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
|
|
|
|
|
2020-04-18 10:28:37 +02:00
|
|
|
echo "LAST_VERSION: ${LAST_VERSION}"
|
|
|
|
echo "RELEASE_VERSION: ${RELEASE_VERSION} (this release)"
|
|
|
|
echo "DEVELOPMENT_VERSION: ${DEVELOPMENT_VERSION} (the next version after the release)"
|
2017-02-25 20:07:37 +01:00
|
|
|
echo "CURRENT_BRANCH: ${CURRENT_BRANCH}"
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Is this correct?"
|
|
|
|
echo
|
2020-04-18 10:28:37 +02:00
|
|
|
echo "Press enter to continue... (or CTRL+C to cancel)"
|
2021-04-18 19:25:28 +02:00
|
|
|
read -r
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2020-04-18 10:28:37 +02:00
|
|
|
export LAST_VERSION
|
2015-09-18 11:25:30 +02:00
|
|
|
export RELEASE_VERSION
|
|
|
|
export DEVELOPMENT_VERSION
|
|
|
|
export CURRENT_BRANCH
|
|
|
|
|
2022-06-04 15:49:01 +02:00
|
|
|
# check for SNAPSHOT version of pmd.build-tools.version
|
|
|
|
BUILD_TOOLS_VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=pmd.build-tools.version -q -DforceStdout)
|
|
|
|
BUILD_TOOLS_VERSION_RELEASE=${BUILD_TOOLS_VERSION%-SNAPSHOT}
|
|
|
|
if [ "${BUILD_TOOLS_VERSION}" != "${BUILD_TOOLS_VERSION_RELEASE}" ]; then
|
|
|
|
echo "Error: version pmd.build-tools.version is ${BUILD_TOOLS_VERSION} - snapshot is not allowed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-04-24 12:24:47 +02:00
|
|
|
echo "* Update version info in **docs/_config.yml**."
|
|
|
|
echo " remove the SNAPSHOT from site.pmd.version"
|
|
|
|
echo
|
2024-06-28 12:57:07 +02:00
|
|
|
echo "* Update date info in **docs/_config.yml**."
|
|
|
|
echo " date: $(date -u +%Y-%m-%d)"
|
|
|
|
echo
|
2019-03-30 17:35:40 +01:00
|
|
|
echo "* Update **pmd-apex/src/main/resources/rulesets/apex/quickstart.xml** and"
|
2019-03-31 11:54:23 +02:00
|
|
|
echo " **pmd-java/src/main/resources/rulesets/java/quickstart.xml** with the new rules."
|
2019-03-30 17:35:40 +01:00
|
|
|
echo
|
2017-12-15 15:27:57 +01:00
|
|
|
echo "* Update **../pmd.github.io/_config.yml** to mention the new release"
|
|
|
|
echo
|
2023-09-29 20:19:50 +02:00
|
|
|
echo "* Update property \`pmd-designer.version\` in **pom.xml** to reference the version, that will be released"
|
|
|
|
echo " later in this process."
|
2019-03-11 15:30:33 +01:00
|
|
|
echo
|
2015-09-18 11:25:30 +02:00
|
|
|
echo "Press enter to continue..."
|
2021-04-18 19:25:28 +02:00
|
|
|
read -r
|
2018-09-30 11:05:18 +02:00
|
|
|
|
2020-04-18 10:28:37 +02:00
|
|
|
|
2024-07-05 10:40:28 +02:00
|
|
|
# determine current milestone
|
|
|
|
MILESTONE_JSON=$(curl -s "https://api.github.com/repos/pmd/pmd/milestones?state=all&direction=desc&per_page=5"|jq ".[] | select(.title == \"$RELEASE_VERSION\")")
|
|
|
|
MILESTONE=$(echo "$MILESTONE_JSON" | jq .number)
|
|
|
|
|
|
|
|
# determine dependency updates
|
|
|
|
DEPENDENCIES_JSON=$(curl -s "https://api.github.com/repos/pmd/pmd/issues?labels=dependencies&state=closed&direction=asc&per_page=50&page=1&milestone=${MILESTONE}")
|
|
|
|
DEPENDENCIES_COUNT=$(echo "$DEPENDENCIES_JSON" | jq length)
|
|
|
|
DEPENDENCIES=""
|
|
|
|
if [ $DEPENDENCIES_COUNT -gt 0 ]; then
|
|
|
|
DEPENDENCIES=$(
|
|
|
|
echo "### 📦 Dependency updates"
|
|
|
|
echo "$DEPENDENCIES_JSON" | jq --raw-output '.[] | "* [#\(.number)](https://github.com/pmd/pmd/issues/\(.number)): \(.title)"'
|
|
|
|
)
|
|
|
|
else
|
|
|
|
DEPENDENCIES=$(
|
|
|
|
echo "### 📦 Dependency updates"
|
|
|
|
echo "No dependency updates"
|
|
|
|
)
|
|
|
|
fi
|
2020-04-18 10:28:37 +02:00
|
|
|
|
2024-07-05 10:40:28 +02:00
|
|
|
# calculating stats for release notes (excluding dependency updates)
|
|
|
|
STATS_CLOSED_ISSUES=$(echo "$MILESTONE_JSON" | jq .closed_issues)
|
2020-04-18 10:28:37 +02:00
|
|
|
STATS=$(
|
2023-03-02 10:26:18 +01:00
|
|
|
echo "### 📈 Stats"
|
2021-04-18 19:25:28 +02:00
|
|
|
echo "* $(git log pmd_releases/"${LAST_VERSION}"..HEAD --oneline --no-merges |wc -l) commits"
|
2024-07-05 10:40:28 +02:00
|
|
|
echo "* $(($STATS_CLOSED_ISSUES - $DEPENDENCIES_COUNT)) closed tickets & PRs"
|
2021-04-18 19:25:28 +02:00
|
|
|
echo "* Days since last release: $(( ( $(date +%s) - $(git log --max-count=1 --format="%at" pmd_releases/"${LAST_VERSION}") ) / 86400))"
|
2020-04-18 10:28:37 +02:00
|
|
|
)
|
|
|
|
|
2024-07-05 10:40:28 +02:00
|
|
|
|
2020-04-18 10:28:37 +02:00
|
|
|
TEMP_RELEASE_NOTES=$(cat docs/pages/release_notes.md)
|
2024-07-05 10:40:28 +02:00
|
|
|
TEMP_RELEASE_NOTES=${TEMP_RELEASE_NOTES/\{\% endtocmaker \%\}/${DEPENDENCIES//\&/\\\&}$'\n'$'\n'${STATS//\&/\\\&}$'\n'$'\n'\{\% endtocmaker \%\}}
|
2020-04-18 10:28:37 +02:00
|
|
|
echo "${TEMP_RELEASE_NOTES}" > docs/pages/release_notes.md
|
|
|
|
|
|
|
|
echo
|
2024-07-05 10:40:28 +02:00
|
|
|
echo "Updated dependencies and stats in release notes:"
|
|
|
|
echo "$DEPENDENCIES"
|
2020-04-18 10:28:37 +02:00
|
|
|
echo "$STATS"
|
|
|
|
echo
|
2020-04-24 08:41:01 +02:00
|
|
|
echo "Please verify docs/pages/release_notes.md"
|
2020-04-18 10:28:37 +02:00
|
|
|
echo
|
2020-04-24 08:41:01 +02:00
|
|
|
echo "Press enter to continue..."
|
2021-04-18 19:25:28 +02:00
|
|
|
read -r
|
2020-04-18 10:28:37 +02:00
|
|
|
|
2018-09-30 11:05:18 +02:00
|
|
|
# install bundles needed for rendering release notes
|
2020-07-31 14:08:20 +02:00
|
|
|
bundle config set --local path vendor/bundle
|
|
|
|
bundle config set --local with release_notes_preprocessing
|
|
|
|
bundle install
|
2018-09-30 11:05:18 +02:00
|
|
|
|
2021-04-18 19:25:28 +02:00
|
|
|
RELEASE_NOTES_POST="_posts/$(date -u +%Y-%m-%d)-PMD-${RELEASE_VERSION}.md"
|
|
|
|
export RELEASE_NOTES_POST
|
2018-09-30 11:05:18 +02:00
|
|
|
echo "Generating ../pmd.github.io/${RELEASE_NOTES_POST}..."
|
2021-04-15 18:19:47 +02:00
|
|
|
NEW_RELEASE_NOTES=$(bundle exec docs/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
|
2021-04-18 19:25:28 +02:00
|
|
|
cat > "../pmd.github.io/${RELEASE_NOTES_POST}" <<EOF
|
2018-10-03 11:30:24 +02:00
|
|
|
---
|
|
|
|
layout: post
|
|
|
|
title: PMD ${RELEASE_VERSION} released
|
|
|
|
---
|
|
|
|
${NEW_RELEASE_NOTES}
|
|
|
|
EOF
|
2018-09-30 11:05:18 +02:00
|
|
|
|
2015-09-18 11:25:30 +02:00
|
|
|
echo "Committing current changes (pmd)"
|
2018-05-29 17:11:40 -03:00
|
|
|
|
2015-09-18 11:25:30 +02:00
|
|
|
git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
|
|
|
|
(
|
|
|
|
cd ../pmd.github.io
|
2021-04-18 19:25:28 +02:00
|
|
|
git add "${RELEASE_NOTES_POST}"
|
|
|
|
changes=$(git status --porcelain 2>/dev/null| grep -c -E "^[AMDRC]")
|
|
|
|
if [ "$changes" -gt 0 ]; then
|
2019-10-31 18:27:57 +01:00
|
|
|
echo "Committing current changes (pmd.github.io)"
|
2024-03-22 08:02:52 +01:00
|
|
|
git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
|
2019-10-31 18:27:57 +01:00
|
|
|
fi
|
2015-09-18 11:25:30 +02:00
|
|
|
)
|
|
|
|
|
2023-11-16 12:53:38 +01:00
|
|
|
# check that there are no uncommitted changes
|
|
|
|
UNCOMMITTED_CHANGES=$(git status --short --untracked-files=no)
|
|
|
|
if [ -n "${UNCOMMITTED_CHANGES}" ]; then
|
|
|
|
echo "There are uncommitted changes:"
|
|
|
|
echo "${UNCOMMITTED_CHANGES}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
# check that there are no SNAPSHOT dependencies -> done by the enforcer plugin, see enforce-no-snapshots
|
|
|
|
echo "Change version in the POMs to ${RELEASE_VERSION} and update build timestamp"
|
|
|
|
./mvnw --quiet versions:set -DnewVersion="${RELEASE_VERSION}" -DgenerateBackupPoms=false -DupdateBuildOutputTimestampPolicy=always
|
|
|
|
echo "Transform the SCM information in the POM"
|
2024-03-21 13:51:36 +01:00
|
|
|
sed -i "s|<tag>HEAD</tag>|<tag>pmd_releases/${RELEASE_VERSION}</tag>|" pom.xml
|
2023-11-16 12:53:38 +01:00
|
|
|
echo "Run the project tests against the changed POMs to confirm everything is in running order (skipping cli and dist)"
|
2024-03-07 12:20:02 +01:00
|
|
|
# note: skipping pmd in order to avoid failures due to #4757
|
|
|
|
./mvnw clean verify -Dskip-cli-dist -Dpmd.skip=true -Dcpd.skip=true -Pgenerate-rule-docs
|
2023-11-16 12:53:38 +01:00
|
|
|
echo "Commit and create tag"
|
|
|
|
git commit -a -m "[release] prepare release pmd_releases/${RELEASE_VERSION}"
|
|
|
|
git tag -m "[release] copy for tag pmd_releases/${RELEASE_VERSION}" "pmd_releases/${RELEASE_VERSION}"
|
2024-03-22 16:10:56 +01:00
|
|
|
echo "Push tag pmd_releases/${RELEASE_VERSION}"
|
2023-11-16 12:53:38 +01:00
|
|
|
git push origin tag "pmd_releases/${RELEASE_VERSION}"
|
|
|
|
|
2015-09-18 11:25:30 +02:00
|
|
|
|
|
|
|
echo
|
2020-12-04 17:34:09 +01:00
|
|
|
echo "Tag has been pushed.... now check github actions: <https://github.com/pmd/pmd/actions>"
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
2024-03-22 16:10:56 +01:00
|
|
|
echo "Now wait, until first stage of the release is finished successfully..."
|
2024-06-28 12:57:07 +02:00
|
|
|
echo "You don't need to wait until artifacts are in maven central, just the GitHub Action must be successful."
|
2024-03-22 16:10:56 +01:00
|
|
|
echo
|
|
|
|
echo "If it is failing, you can fix the code/scripts and force push the tag via"
|
|
|
|
echo
|
|
|
|
echo " git tag -d \"pmd_releases/${RELEASE_VERSION}\""
|
|
|
|
echo " git tag -m \"[release] copy for tag pmd_releases/${RELEASE_VERSION}\" \"pmd_releases/${RELEASE_VERSION}\""
|
|
|
|
echo " git push origin tag \"pmd_releases/${RELEASE_VERSION}\" --force"
|
|
|
|
echo
|
|
|
|
echo "However: This is only possible, if the artefacts have not been pushed to maven central yet..."
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
2024-06-28 12:57:07 +02:00
|
|
|
echo "Press enter to continue, once the GitHub Action finished successfully..."
|
2021-04-18 19:25:28 +02:00
|
|
|
read -r
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2024-03-22 16:10:56 +01:00
|
|
|
echo
|
|
|
|
echo "Update POMs to set the new development version ${DEVELOPMENT_VERSION}"
|
|
|
|
./mvnw --quiet versions:set -DnewVersion="${DEVELOPMENT_VERSION}" -DgenerateBackupPoms=false -DupdateBuildOutputTimestampPolicy=never
|
|
|
|
sed -i "s|<tag>pmd_releases/${RELEASE_VERSION}</tag>|<tag>HEAD</tag>|" pom.xml
|
|
|
|
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
2018-02-25 12:05:56 +01:00
|
|
|
echo "Check the milestone on github:"
|
|
|
|
echo "<https://github.com/pmd/pmd/milestones>"
|
|
|
|
echo " --> move any open issues to the next milestone, close the current milestone"
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
2017-02-25 20:07:37 +01:00
|
|
|
echo
|
|
|
|
echo "Prepare Next development version:"
|
2018-01-21 16:51:52 +01:00
|
|
|
echo "* Update version/date info in **docs/_config.yml**."
|
2020-05-24 18:14:55 +02:00
|
|
|
echo " move version to previous_version, increase version, make sure it is a SNAPSHOT version"
|
|
|
|
echo " otherwise the javadoc links won't work during development"
|
|
|
|
echo " also update the date, e.g. ??-month-year."
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
2018-05-29 16:08:48 -03:00
|
|
|
echo
|
|
|
|
echo "Press enter to continue..."
|
2021-04-18 19:25:28 +02:00
|
|
|
read -r
|
2018-05-29 16:08:48 -03:00
|
|
|
|
2018-05-29 17:42:27 -03:00
|
|
|
# update release_notes_old
|
2018-05-30 09:01:00 +02:00
|
|
|
OLD_RELEASE_NOTES=$(tail -n +8 docs/pages/release_notes_old.md)
|
2021-04-18 19:25:28 +02:00
|
|
|
OLD_RELEASE_NOTES_HEADER=$(head -n 7 docs/pages/release_notes_old.md)
|
|
|
|
echo "${OLD_RELEASE_NOTES_HEADER}
|
|
|
|
${NEW_RELEASE_NOTES}
|
2021-04-24 18:37:53 +02:00
|
|
|
|
2021-04-18 19:25:28 +02:00
|
|
|
${OLD_RELEASE_NOTES}" > docs/pages/release_notes_old.md
|
2018-05-29 17:42:27 -03:00
|
|
|
|
2018-05-29 16:08:48 -03:00
|
|
|
# reset release notes template
|
|
|
|
cat > docs/pages/release_notes.md <<EOF
|
2017-08-15 14:08:48 +02:00
|
|
|
---
|
|
|
|
title: PMD Release Notes
|
|
|
|
permalink: pmd_release_notes.html
|
|
|
|
keywords: changelog, release notes
|
|
|
|
---
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2024-06-20 11:52:48 +02:00
|
|
|
## {{ site.pmd.date | date: "%d-%B-%Y" }} - {{ site.pmd.version }}
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2018-08-15 04:08:15 +02:00
|
|
|
The PMD team is pleased to announce PMD {{ site.pmd.version }}.
|
2017-02-25 20:07:37 +01:00
|
|
|
|
2018-08-15 04:08:15 +02:00
|
|
|
This is a {{ site.pmd.release_type }} release.
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2018-09-02 14:51:23 +02:00
|
|
|
{% tocmaker is_release_notes_processor %}
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2023-03-02 10:26:18 +01:00
|
|
|
### 🚀 New and noteworthy
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2023-03-02 10:26:18 +01:00
|
|
|
### 🐛 Fixed Issues
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2023-03-02 10:26:18 +01:00
|
|
|
### 🚨 API Changes
|
2017-02-25 20:07:37 +01:00
|
|
|
|
2023-03-02 10:26:18 +01:00
|
|
|
### ✨ External Contributions
|
2015-09-18 11:25:30 +02:00
|
|
|
|
2018-08-18 17:39:29 +02:00
|
|
|
{% endtocmaker %}
|
|
|
|
|
2015-09-18 11:25:30 +02:00
|
|
|
EOF
|
2018-05-29 16:08:48 -03:00
|
|
|
|
2024-03-22 16:10:56 +01:00
|
|
|
echo "Committing current changes on branch ${CURRENT_BRANCH}"
|
|
|
|
# note: using [skip ci] as only the first stage is done and the full build
|
|
|
|
# requires pmd-designer to be present, which might not be the case yet...
|
2023-11-16 12:53:38 +01:00
|
|
|
git commit -a -m "[release] Prepare next development version [skip ci]"
|
2024-03-22 16:10:56 +01:00
|
|
|
echo "Push branch ${CURRENT_BRANCH}"
|
2021-04-18 19:25:28 +02:00
|
|
|
git push origin "${CURRENT_BRANCH}"
|
2023-09-29 20:19:50 +02:00
|
|
|
|
|
|
|
echo
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
|
|
|
echo
|
2023-09-29 20:19:50 +02:00
|
|
|
echo "* Wait until the new version is synced to maven central and appears as latest version in"
|
|
|
|
echo " <https://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd/maven-metadata.xml>."
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo "Then proceed with releasing pmd-designer..."
|
2024-09-13 09:59:51 +02:00
|
|
|
echo "<https://github.com/pmd/pmd-designer/blob/main/releasing.md>"
|
2023-09-29 20:19:50 +02:00
|
|
|
echo
|
|
|
|
echo "Press enter to continue when pmd-designer is available in maven-central..."
|
2024-02-15 09:01:55 +01:00
|
|
|
echo "<https://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd-designer/maven-metadata.xml>."
|
2023-11-16 12:53:38 +01:00
|
|
|
echo
|
|
|
|
echo "Note: If there is no new pmd-designer release needed, you can directly proceed."
|
2023-09-29 20:19:50 +02:00
|
|
|
read -r
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Continuing with release of pmd-cli and pmd-dist..."
|
2024-03-22 16:10:56 +01:00
|
|
|
echo "Before proceeding however, wait another 10 minutes, so that the freshly released artefacts"
|
|
|
|
echo "are indeed available from maven central. The GitHub runners might not yet see them..."
|
|
|
|
echo "If that happens, the build job needs to be started again, maybe the runner cache needs to be cleared as well."
|
2023-09-29 20:19:50 +02:00
|
|
|
echo
|
2023-11-16 12:53:38 +01:00
|
|
|
echo "Go to <https://github.com/pmd/pmd/actions/workflows/build.yml> and manually trigger a new build"
|
|
|
|
echo "from tag 'pmd_releases/${RELEASE_VERSION}' and with option 'Build only modules cli and dist' checked."
|
|
|
|
echo
|
|
|
|
echo "This triggers the second stage release and eventually publishes the release on GitHub."
|
|
|
|
echo
|
|
|
|
echo "Now check github actions: <https://github.com/pmd/pmd/actions>"
|
2023-09-29 20:19:50 +02:00
|
|
|
echo
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
2024-03-22 16:10:56 +01:00
|
|
|
echo "Verification: (see also <https://docs.pmd-code.org/latest/pmd_projectdocs_committers_releasing.html>)"
|
|
|
|
echo "* Release on GitHub: <https://github.com/pmd/pmd/releases/tag/pmd_releases/${RELEASE_VERSION}>"
|
|
|
|
echo " * should contain release notes"
|
|
|
|
echo " * should be published"
|
|
|
|
echo " * should contain release assets (bin, src, doc, cyclondx.json, cyclondx.xml)"
|
|
|
|
echo "* Release Assets on sourceforge: <https://sourceforge.net/projects/pmd/files/pmd/${RELEASE_VERSION}/>"
|
|
|
|
echo " * Default download should be new version"
|
|
|
|
echo " * All assets are there (bin, src, doc, cyclondx.json, cyclondx.xml, ReadMe.md)"
|
|
|
|
echo "* News entry on sourceforge: <https://sourceforge.net/p/pmd/news/>"
|
|
|
|
echo "* Latest documentation points to new release: <https://docs.pmd-code.org/latest/>"
|
|
|
|
echo "* JavaDoc API Doc is available: <https://docs.pmd-code.org/apidocs/pmd-core/${RELEASE_VERSION}/>"
|
|
|
|
echo "* All artefacts are on maven central, especially pmd-cli"
|
|
|
|
echo " * <https://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd-cli/${RELEASE_VERSION}/>"
|
|
|
|
echo " * <https://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd-core/${RELEASE_VERSION}/>"
|
|
|
|
echo " * <https://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd-java/${RELEASE_VERSION}/>"
|
|
|
|
echo " * <https://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd-designer/${RELEASE_VERSION}/>"
|
|
|
|
echo "* Regression Tester baseline has been created: <https://pmd-code.org/pmd-regression-tester/>"
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
2018-08-17 10:49:23 +02:00
|
|
|
echo "* Send out an announcement mail to the mailing list:"
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
2017-02-25 21:12:18 +01:00
|
|
|
echo "To: PMD Developers List <pmd-devel@lists.sourceforge.net>"
|
2021-04-18 19:08:51 +02:00
|
|
|
echo "Subject: [ANNOUNCE] PMD ${RELEASE_VERSION} released"
|
2018-02-25 12:05:56 +01:00
|
|
|
echo
|
2021-04-18 19:08:51 +02:00
|
|
|
echo " You can copy the same text from <https://sourceforge.net/p/pmd/news/>."
|
2017-02-25 20:07:37 +01:00
|
|
|
echo
|
2015-09-18 11:25:30 +02:00
|
|
|
echo
|
2020-02-08 12:45:40 +01:00
|
|
|
tweet="PMD ${RELEASE_VERSION} released: https://github.com/pmd/pmd/releases/tag/pmd_releases/${RELEASE_VERSION} #PMD"
|
|
|
|
tweet="${tweet// /%20}"
|
|
|
|
tweet="${tweet//:/%3A}"
|
|
|
|
tweet="${tweet//#/%23}"
|
|
|
|
tweet="${tweet//\//%2F}"
|
2021-06-26 11:25:26 +02:00
|
|
|
tweet="${tweet//$'\r'/}"
|
|
|
|
tweet="${tweet//$'\n'/%0A}"
|
2024-06-28 12:57:07 +02:00
|
|
|
echo "* Tweet about this release on https://x.com/pmd_analyzer:"
|
|
|
|
echo " <https://x.com/intent/post?text=$tweet>"
|
2024-04-26 14:56:36 +02:00
|
|
|
echo "* Post this also into <https://matrix.to/#/#pmd_pmd:gitter.im>:"
|
|
|
|
echo " PMD ${RELEASE_VERSION} released: https://github.com/pmd/pmd/releases/tag/pmd_releases/${RELEASE_VERSION} #PMD"
|
2020-02-08 12:45:40 +01:00
|
|
|
echo
|
2024-03-22 08:02:52 +01:00
|
|
|
echo
|
|
|
|
echo "Now waiting for the release to be finished..."
|
|
|
|
echo "Press enter, to continue to push pmd.github.io changes"
|
|
|
|
read -r
|
|
|
|
|
2024-03-22 16:10:56 +01:00
|
|
|
echo "Pushing changes to <https://pmd.github.io>..."
|
2024-03-22 08:02:52 +01:00
|
|
|
(
|
|
|
|
cd ../pmd.github.io
|
|
|
|
git push
|
|
|
|
)
|
|
|
|
|
2015-09-18 11:25:30 +02:00
|
|
|
echo "------------------------------------------"
|
|
|
|
echo "Done."
|
|
|
|
echo "------------------------------------------"
|
|
|
|
echo
|