diff --git a/.travis.yml b/.travis.yml index caa0a80e3b..f1a33c1699 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,6 @@ deploy: file: - pmd-dist/target/pmd-*.zip - target/pmd-doc-*.zip - # TODO : This won't copy the changelog to GitHub skip_cleanup: true on: tags: true @@ -54,7 +53,7 @@ env: - secure: "mmHRnK/8CHfgtwaTN3MgjFD1R8EVQhIb/a0Aag3gPaHWW52Ex6xWG7GsF4kRcdzHdIdrQxHZTiDa2oVMWbnQ16CAu4dZJadwTxhBW4JmE1tsi2C6i+uwMBPvnKBXHwt+QOAqNB0L/ByYwWLkucSLoyRs6qU0i7sJ3ZC/EPCuLI8VfBlFUVegSbp2WmclmFnxOi5MKr15Zwd8BGgyWUsvd1OHxhvO3Xr/ZPO4R+1kIgyojloTMu6oGM/shYgsrUXgmI/WvZRTq+25SRCjUmATJtuDXXgVeJtYabi/+Zju5Z7K06oaKvFYM+BgZWPmGQkVCxKVjSlug0rx6+qgRKIf/B/cPxmQDS0ZZVDmDcbxeibBL9JhRqIDwDb0XS9t1qBXvIJ5E4ZmdX/XuvLCnC4xJptu/vHyKl1wbRM3dcXEBk8J0knJc4JvY2yupF3LS32sfEHftLwzr63U3/0dOQvsCSJRBy5zgI8ieABUZAeZmmaQ6RCGOTEYrGO2G4CCF2uVq4YdrCOsfmrb0DzH8llNMkXKzXlITRvmkuBlTRRKxGnPzS3vf0iicdAkmTiU5u7lArFFc7IKcW4ypO+RKDTUpq74K+UZBI9eBjV7Po368EO8epJ5aIx32a2kyS/hYWkS/dZh7I0fNZa2qBUceZO/KZGRjH4dQFW9t0J9Q7LLXJY=" - secure: "geOU/7VR83KYTOCR5XkgFqnHJEnXeB6hNDE7UFcN4ZsL9uVLhxlDVWV3ujJ87nyBzggG1KfSnUx11UwOQrbBl0K6sEXo/B2q5ytOsWoSLi7+0qm/uhhw/DTBOq57p8TIDKFM7rDhO7uajSn7Y86LeZkh9wIs5265Fh1yhCkiPbczDUMsX4P0GGg2qg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6P8/RXfZg/lc5ADOuM2DM8oXPpZuqOa/g31LWQOSCuEnQ1G16vbLgipSPpgAc7jYWD5cywhG9dLkiKaZDh5x0meLM2RoAgz6eAnQfTTqJ68OM9o9yXjubEedsNpNRAr9/DXMd+fbh10W2vbvL5HCNB3lic3anehhR9le7PLuEKxg654wXt3KM2PZGVWbotIyBK0CvGzqGkppvwT23QdDDqSdkWuGQIhGQ0xBOdYkwebycxP5wwPUmObG+mymQ1Be2BXvmghttsiJdKlt4CVSYOJUMus6kU32G95hdTgKblsX4J1Of2i1nYsjyMKh3k945tqXwQrIsxOOQug0oIkz24zlLaOaQcorWtJ6Y1HPaZKpVIFUEF0y8Uq/O4oB2bOYC6WDUQfpj7nRG6xbi+BeBS84m1ttCEk4g=" # Secure Keys, that need to be set for snapshot builds diff --git a/.travis/release.sh b/.travis/release.sh index 9db720c79d..a3e6606d9a 100644 --- a/.travis/release.sh +++ b/.travis/release.sh @@ -14,7 +14,7 @@ curl -H "Accept: application/json" -X PUT -d "default=windows&default=mac&defaul # Assumes, the release has already been created by travis github releases provider RELEASE_ID=$(curl -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" https://api.github.com/repos/pmd/pmd/releases/tags/pmd_releases/${RELEASE_VERSION}|jq ".id") RELEASE_NAME="PMD ${RELEASE_VERSION} ($(date -u +%d-%B-%Y))" -RELEASE_BODY=$(cat src/site/markdown/overview/changelog.md) +RELEASE_BODY=$(tail -n +3 src/site/markdown/overview/changelog.md) # skips the first 2 lines - the heading 'PMD Release Notes' RELEASE_BODY="${RELEASE_BODY//$'\\'/\\\\}" RELEASE_BODY="${RELEASE_BODY//$'\r'/}" RELEASE_BODY="${RELEASE_BODY//$'\n'/\\r\\n}" @@ -26,7 +26,9 @@ cat > release-edit-request.json < .git/info/sparse-checkout + git pull --depth=1 origin master + rsync -a ../target/pmd-doc-${RELEASE_VERSION}/ pmd-${RELEASE_VERSION}/ + git add pmd-${RELEASE_VERSION} + git commit -q -m "Added pmd-${RELEASE_VERSION}" + git rm -qr latest + cp -a pmd-${RELEASE_VERSION} latest + git add latest + git commit -q -m "Copying pmd-${RELEASE_VERSION} to latest" + git push origin master ) diff --git a/src/site/markdown/customizing/pmd-release-process.md b/src/site/markdown/customizing/pmd-release-process.md index c687bcef1f..c2ee60e77f 100644 --- a/src/site/markdown/customizing/pmd-release-process.md +++ b/src/site/markdown/customizing/pmd-release-process.md @@ -7,6 +7,13 @@ This page describes the current status of the release process. +Since versions 5.4.5 / 5.5.4 there is an automated release process using [travis-ci](https://travis-ci.org) +in place. However, there are still a few steps, that need manual examination. + +Note: You can find a small shell script in the root of the repo: `do-release.sh`. This script guides you +through the release process. + + ## Preparations Make sure code is up to date and everything is committed and pushed with git: @@ -15,207 +22,171 @@ Make sure code is up to date and everything is committed and pushed with git: $ git pull $ git status -**Checklist for release preparation:** - -* Ensure all the new rules are listed in a the proper file: - `pmd-core/src/main/resources/rulesets/releases/.xml` file. -* Update version/release info in **src/site/markdown/changelog.md**. -* Update **../pmd.github.io/latest/index.html** of our website, to redirect to the new version -* Update **../pmd.github.io/index.html** to mention the new release - $ mvn clean install +### The Release Notes -Unzip and test manually (just to be on the safe side of the road): +At a very minimum, the current date must be noted in the release notes. Also, the version +must be adjusted. E.g. by removing "-SNAPSHOT". + +You can find the release notes here: `src/site/markdown/overview/changelog.md`. + +The release notes usual mention any new rules that have been added since the last release. +Please double check the file `pmd-core/src/main/resources/rulesets/releases/.xml`, so +that all new rules are listed. + +Check in all (version) changes to branch master or any other branch, from which the release takes place: + + $ git commit -a -m "Prepare pmd release " + $ git push + + +### The Homepage + +The github repo `pmd.github.io` hosts the homepage for [https://pmd.github.io](https://pmd.github.io). +The `index.html` page needes to be updated to display the new release. The new release is mentioned + +* on the start page +* in the announcements +* and in the previous releases section - cd pmd-dist/target; unzip pmd-bin-.zip; cd pmd-bin- - ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f xml -R rulesets/java/unusedcode.xml - ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f xml -R java-unusedcode - ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f html -R rulesets/java/unusedcode.xml - cd ..; cd ../.. Check in all (version) changes to branch master: $ git commit -a -m "Prepare pmd release " - -## Release Branch - -Let's have maven create a release branch for us (note - this is of course not -needed if you are already on a release/maintenance branch). Maven will automatically -increase the version in branch master. - - $ mvn release:branch -DbranchName=pmd/.x - -In case you create a alpha/preview release and you want to stay with the current -version in master, use these additional properties: - - $ mvn -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false ... - -Note: The property pushChanges is set to false, so that we can manually -push all changes done during the release at the end, when we are sure, -that everything is fine. - -## Create a release - -Now checkout the created branch. - - $ git checkout pmd/.x - -Now let maven create a release tag. + $ git push - $ mvn release:clean - $ mvn release:prepare -Note: For the tag/label name we currently use this naming pattern: -pmd_releases/<major-version>.<minor-version>.<micro-version> +## Creating the release -The next command will checkout PMD from the tag just created and will build -and deploy it to sonatype OSS repositories: +The release is created using the **maven-release-plugin**. This plugin changes the version by basically +removing the "-SNAPSHOT" suffix, builds the changed project locally, commits the version change, creates +a new tag from this commit, changes the version of the project to the next snapshot, commits this change +and pushes everything. - $ mvn release:perform +`RELEASE_VERSION` is the version of the release. It is reused for the tag. `DEVELOPMENT_VERSION` is the +next snapshot version after the release. -### Push your local changes - -If everything is fine, you can push your local changes. - - $ git push origin master - $ git push origin pmd/.x - $ git push origin tag pmd_releases/ - -### Rollback - -Note: If you see a bug and fix it, you can rollback the release -(see the [maven release plugin documentation](http://maven.apache.org/plugins/maven-release-plugin/examples/rollback-release.html)): - - $ mvn release:rollback - -You probably need to delete the release tag manually using the following command (and then -start again with release:clean release:prepare): - - $ git tag -d pmd_releases/ - -## Publish maven artifacts - -Finally, in order to publish the release to Maven central, -you need to release PMD via Sonatype Nexus: - -* Login to -* Go to Staging Repositories page -* Select a staging repository -* Click the close button -* Now you can download the artifacts again and verify they are working. -* Once you are sure they are working, click "Release" and the artifacts are - eventually available through - [maven central](http://repo.maven.apache.org/maven2/net/sourceforge/pmd/pmd/). - -## Create and publish the site / documentation - -You can reuse the cleanly checked out local repository from maven-release-plugin. - - $ cd target/checkout/ - $ mvn site site:stage - -* Before you upload the zip files, unzip and test once (just to be on the safe side of the road): - - $ cd pmd-dist/target; unzip pmd-bin-.zip; cd pmd-bin- - $ ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f xml -R rulesets/java/unusedcode.xml - $ ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f xml -R java-unusedcode - $ ./bin/run.sh pmd -d ../../../pmd-java/src/main/java -language java -f html -R rulesets/java/unusedcode.xml - $ cd ..; cd ../.. - -* While the site will be deployed to github, it's still usefull, to have it downloadable at once: - - $ cd target - $ mv staging pmd-doc- - $ zip -r pmd-doc-.zip pmd-doc-/ - $ cd .. - -* Add the site to the pmd.github.io repo: - - $ rsync -avhP target/pmd-doc-/ ../../../pmd.github.io/pmd-/ - $ (cd ../../../pmd.github.io; git add pmd-; git commit -m "Added pmd-") - -* Upload the zip-files to sourceforge's file section: - - $ rsync -avhP pmd-dist/target/pmd-*-.zip target/pmd-doc-.zip your_sf_login@web.sourceforge.net:/home/frs/project/pmd/pmd// - $ rsync -avhP src/site/markdown/overview/changelog.md your_sf_login@web.sourceforge.net:/home/frs/project/pmd/pmd//ReadMe.md - -* Verify the MD5 sums on [Files](https://sourceforge.net/projects/pmd/files/pmd/) and locally: - - $ md5sum pmd-dist/target/pmd-*-.zip target/pmd-doc-.zip - -* Go to [Files](https://sourceforge.net/projects/pmd/files/pmd/), to folder "pmd/<version>", - and make the new binary pmd zip file the default download for all platforms. - -## Push the repos - -In case of releasing from master: - - $ git push origin master; git push origin tag pmd_releases/ - -In case of releasing from a release branch: - - $ git push origin pmd/.x; git push origin tag pmd_releases/ - -## Create a new release on github - -Go to - -* Select the just pushed tag: "pmd_releases/<version>" -* Set the title: "PMD <version> (DD-MMMM-YYYY)" -* Copy/Paste the changelog.md file -* Upload the 3 zip files (pmd-<version>-{src,bin,doc}.zip). -* Publish the release - -## Submit a news on SF - -* Submit news to SF on the [PMD Project News](https://sourceforge.net/p/pmd/news/) page. You can use - the following template: - - PMD released - - * minor version with lots of bug fixes - * Changelog: https://pmd.github.io/pmd-/overview/changelog.html - * Downloads: https://github.com/pmd/pmd/releases/tag/pmd_releases%2F - * Fixed Bugs: https://sourceforge.net/p/pmd/bugs/milestone/PMD-/ - * Documentation: https://pmd.github.io/pmd-/ + mvn -B release:clean release:prepare \ + -Dtag=pmd_releases/${RELEASE_VERSION} \ + -DreleaseVersion=${RELEASE_VERSION} \ + -DdevelopmentVersion=${DEVELOPMENT_VERSION} -## Prepare the next version +Once the maven plugin has pushed the tag, travis-ci will start and build a new version from this tag. Since +it is a tag build and a released version build, travis-ci will do a couple of additional stuff: -### Create new milestone +* Deploy and release the build to maven central, so that it can be downloaded from + . This is done automatically, if + all unit tests pass on travis-ci. The plugin [nexus-staging-maven-plugin](https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin) is used for that. +* Upload the new binaries to github releases under . It also uploads + the release notes. +* Upload the new binaries additionally to sourceforge, so that they can be downloaded from + , including the release notes. The new binaries are + selected as the new default downloads for PMD. +* Add the documentation of the new release to a subfolder on , also make + this folder available as `latest`. -Under close the milestone "PMD-<version>" -and create a new milestone for the next version (PMD-<version+1>). -### Update changelog +## After the release -* Move version/releaseinfo from **src/site/markdown/overview/changelog.md** to **src/site/markdown/overview/changelog-old.md**. +The release on travis currently takes about 30 minutes. Once this is done, you can spread the news: + +### Submit a news on SF + +Submit news to SF on the [PMD Project News](https://sourceforge.net/p/pmd/news/) page. You can use +the following template: + + PMD released + + * Downloads: https://github.com/pmd/pmd/releases/tag/pmd_releases%2F + * Documentation: https://pmd.github.io/pmd-/ + + And Copy-Paste the release notes + +### Write an email to the mailing list + + To: PMD Developers List + Subject: [ANNOUNCE] PMD released + + + * Downloads: https://github.com/pmd/pmd/releases/tag/pmd_releases%2F + * Documentation: https://pmd.github.io/pmd-/ + + And Copy-Paste the release notes + + +## Prepare the next release + +### Prepare the new release notes + +* Move version/release info from **src/site/markdown/overview/changelog.md** to **src/site/markdown/overview/changelog-old.md**. * Update version/release info in **src/site/markdown/overview/changelog.md**. Use the following template: - # Changelog - - ## ????? - ${DEVELOPMENT_VERSION} - - **New Supported Languages:** - - **Feature Request and Improvements:** - - **New/Modified/Deprecated Rules:** - - **Pull Requests:** - - **Bugfixes:** - - **API Changes:** -* Update pmd-java8/pom.xml - the version is probably wrong. - Set it to the parent's=next development version. -* If you released from a release-branch, now merge the branch back into master. -* Commit and push + # PMD Release Notes + + ## ????? - ${DEVELOPMENT_VERSION} + + The PMD team is pleased to announce PMD ${DEVELOPMENT_VERSION%-SNAPSHOT}. + + This is a bug fixing release. + + ### Table Of Contents + + * [New and noteworthy](#New_and_noteworthy) + * [Fixed Issues](#Fixed_Issues) + * [API Changes](#API_Changes) + * [External Contributions](#External_Contributions) + + ### New and noteworthy + + ### Fixed Issues + + ### API Changes + + ### External Contributions - $ git commit -m "Prepare next development version" - $ git push origin master +Commit and push + + $ git commit -m "Prepare next development version" + $ git push origin master +### Close / Create new milestones + +Manage the milestones under . +Maybe there are some milestones on sourceforge, too: . + + + +## Branches + +### Merging + +If the release was done on a maintenance branch, such as `pmd/5.4.x`, then this branch should be +merge into the next "higher" branches, such as `pmd/5.5.x` and `master`. + +This ensures, that all fixes done on the maintenance branch, finally end up in the other branches. +In theory, the fixes should already be there, but you never now. + + +### Multiple releases + +If releases from multiple branches are being done, the order matters. You should start from the "oldes" branch, +e.g. `pmd/5.4.x`, release from there. Then merge (see above) into the next branch, e.g. `pmd/5.5.x` and release +from there. Then merge into the `master` branch and release from there. This way, the last release done, becomes +automatically the latest release on and on sourceforge. + + +### (Optional) Create a new release branch + +At some point, it might be time for a new maintenance branch. Such a branch is usually created from +the `master` branch. Here are the steps: + +* Create a new branch: `git branch pmd/5.6.x master` +* Update the version in both the new branch and master, e.g. `mvn versions:set -Dversion=5.6.0-SNAPSHOT` + and `mvn versions:set -Dversion=5.7.0-SNAPSHOT`. +* Update the release notes on both the new branch and master +