[ci] Release scripts improvements

- Fix missing SF_BLOG_URL value
- Let pmd/cpd run again
- Use latest build-tools scripts
- Remove release_notes_pmd7 handling
- Wait after pushing the tag before committing
  the changes for next development version
- more verification links

[skip ci]
This commit is contained in:
Andreas Dangel
2024-03-22 16:10:56 +01:00
parent a3e02e1c2a
commit be44a14f1e
5 changed files with 55 additions and 19 deletions

View File

@ -66,8 +66,6 @@ function build() {
# was green before. This is usually checked via a local build, see ./do-release.sh # was green before. This is usually checked via a local build, see ./do-release.sh
if pmd_ci_maven_isReleaseBuild; then if pmd_ci_maven_isReleaseBuild; then
PMD_MAVEN_EXTRA_OPTS+=(-DskipTests=true) PMD_MAVEN_EXTRA_OPTS+=(-DskipTests=true)
# note: skipping pmd in order to avoid failures due to #4757
PMD_MAVEN_EXTRA_OPTS+=(-Dpmd.skip=true -Dcpd.skip=true)
fi fi
# make sure, BUILD_CLI_DIST_ONLY is set to false by default # make sure, BUILD_CLI_DIST_ONLY is set to false by default
@ -119,6 +117,16 @@ function build() {
pmd_ci_log_group_start "Publishing Release" pmd_ci_log_group_start "Publishing Release"
pmd_ci_gh_releases_publishRelease "$GH_RELEASE" pmd_ci_gh_releases_publishRelease "$GH_RELEASE"
pmd_ci_sourceforge_selectDefault "${PMD_CI_MAVEN_PROJECT_VERSION}" pmd_ci_sourceforge_selectDefault "${PMD_CI_MAVEN_PROJECT_VERSION}"
# reconstruct the SF_BLOG_URL - the news entry has been created as draft when running the
# first release stage
local news_title
news_title="PMD ${PMD_CI_MAVEN_PROJECT_VERSION} ($(date -u +%d-%B-%Y)) released"
news_title="${news_title// /-}"
news_title="${news_title//\./}"
news_title="${news_title//\(/}"
news_title="${news_title//\)/}"
news_title="${news_title,,}" # convert to lowercase
SF_BLOG_URL="https://sourceforge.net/rest/p/pmd/news/$(date -u +%Y)/$(date -u +%m)/${news_title// /_}"
pmd_ci_sourceforge_publishBlogPost "$SF_BLOG_URL" pmd_ci_sourceforge_publishBlogPost "$SF_BLOG_URL"
pmd_ci_log_group_end pmd_ci_log_group_end
fi fi

View File

@ -60,7 +60,7 @@ jobs:
run: | run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/23/scripts" >> $GITHUB_ENV echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV
- name: Check Environment - name: Check Environment
shell: bash shell: bash
run: | run: |

View File

@ -24,7 +24,7 @@ jobs:
shell: bash shell: bash
run: | run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/23/scripts" >> $GITHUB_ENV echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV
- name: Sync - name: Sync
run: .ci/git-repo-sync.sh run: .ci/git-repo-sync.sh
shell: bash shell: bash

View File

@ -36,7 +36,7 @@ jobs:
run: | run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/23/scripts" >> $GITHUB_ENV echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV
- name: Check Environment - name: Check Environment
shell: bash shell: bash
run: | run: |

View File

@ -4,7 +4,7 @@
set -e set -e
# Make sure, everything is English... # Make sure, everything is English...
export LANG=C.UTF-8 export LANG=en_US.UTF-8
# verify the current directory # verify the current directory
if [ ! -f pom.xml ] || [ ! -d ../pmd.github.io ]; then if [ ! -f pom.xml ] || [ ! -d ../pmd.github.io ]; then
@ -136,7 +136,7 @@ echo "* Days since last release: $(( ( $(date +%s) - $(git log --max-count=1 --f
) )
TEMP_RELEASE_NOTES=$(cat docs/pages/release_notes.md) TEMP_RELEASE_NOTES=$(cat docs/pages/release_notes.md)
TEMP_RELEASE_NOTES=${TEMP_RELEASE_NOTES/\{\% endtocmaker \%\}/${STATS//\&/\\\&}$'\n'$'\n'\{\% endtocmaker \%\}$'\n'} TEMP_RELEASE_NOTES=${TEMP_RELEASE_NOTES/\{\% endtocmaker \%\}/${STATS//\&/\\\&}$'\n'$'\n'\{\% endtocmaker \%\}}
echo "${TEMP_RELEASE_NOTES}" > docs/pages/release_notes.md echo "${TEMP_RELEASE_NOTES}" > docs/pages/release_notes.md
echo echo
@ -165,9 +165,6 @@ title: PMD ${RELEASE_VERSION} released
${NEW_RELEASE_NOTES} ${NEW_RELEASE_NOTES}
EOF EOF
echo "Prerendering release notes pmd 7..."
RELEASE_NOTES_PMD7=$(bundle exec docs/render_release_notes.rb docs/pages/release_notes_pmd7.md)
echo "Committing current changes (pmd)" echo "Committing current changes (pmd)"
git commit -a -m "Prepare pmd release ${RELEASE_VERSION}" git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
@ -199,23 +196,31 @@ echo "Run the project tests against the changed POMs to confirm everything is in
echo "Commit and create tag" echo "Commit and create tag"
git commit -a -m "[release] prepare release pmd_releases/${RELEASE_VERSION}" 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}" git tag -m "[release] copy for tag pmd_releases/${RELEASE_VERSION}" "pmd_releases/${RELEASE_VERSION}"
echo "Update POMs to set the new development version ${DEVELOPMENT_VERSION}" echo "Push tag pmd_releases/${RELEASE_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
echo "Commit"
git commit -a -m "[release] prepare for next development iteration"
echo "Push branch and tag pmd_releases/${RELEASE_VERSION}"
git push origin "${CURRENT_BRANCH}"
git push origin tag "pmd_releases/${RELEASE_VERSION}" git push origin tag "pmd_releases/${RELEASE_VERSION}"
echo echo
echo "Tag has been pushed.... now check github actions: <https://github.com/pmd/pmd/actions>" echo "Tag has been pushed.... now check github actions: <https://github.com/pmd/pmd/actions>"
echo echo
echo "Now wait, until first stage of the release is finished successfully..."
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..."
echo echo
echo "Press enter to continue..." echo "Press enter to continue..."
read -r read -r
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
echo echo
echo "Check the milestone on github:" echo "Check the milestone on github:"
echo "<https://github.com/pmd/pmd/milestones>" echo "<https://github.com/pmd/pmd/milestones>"
@ -271,7 +276,11 @@ This is a {{ site.pmd.release_type }} release.
EOF EOF
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...
git commit -a -m "[release] Prepare next development version [skip ci]" git commit -a -m "[release] Prepare next development version [skip ci]"
echo "Push branch ${CURRENT_BRANCH}"
git push origin "${CURRENT_BRANCH}" git push origin "${CURRENT_BRANCH}"
echo echo
@ -292,6 +301,9 @@ read -r
echo echo
echo "Continuing with release of pmd-cli and pmd-dist..." echo "Continuing with release of pmd-cli and pmd-dist..."
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."
echo echo
echo "Go to <https://github.com/pmd/pmd/actions/workflows/build.yml> and manually trigger a new build" 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 "from tag 'pmd_releases/${RELEASE_VERSION}' and with option 'Build only modules cli and dist' checked."
@ -301,8 +313,23 @@ echo
echo "Now check github actions: <https://github.com/pmd/pmd/actions>" echo "Now check github actions: <https://github.com/pmd/pmd/actions>"
echo echo
echo echo
echo "Verify the new release on github: <https://github.com/pmd/pmd/releases/tag/pmd_releases/${RELEASE_VERSION}>" echo "Verification: (see also <https://docs.pmd-code.org/latest/pmd_projectdocs_committers_releasing.html>)"
echo "and the news entry at <https://sourceforge.net/p/pmd/news/>" 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/>"
echo echo
echo "* Send out an announcement mail to the mailing list:" echo "* Send out an announcement mail to the mailing list:"
echo echo
@ -327,6 +354,7 @@ echo "Now waiting for the release to be finished..."
echo "Press enter, to continue to push pmd.github.io changes" echo "Press enter, to continue to push pmd.github.io changes"
read -r read -r
echo "Pushing changes to <https://pmd.github.io>..."
( (
cd ../pmd.github.io cd ../pmd.github.io
git push git push