#!/bin/bash set -ev RELEASE_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec) # Deploy to ossrh has already been done with the usual build. See build-push.sh # The site has been built before, the files have already been uploaded to sourceforge. # Since this is a release, making the binary the new default file... curl -H "Accept: application/json" -X PUT -d "default=windows&default=mac&default=linux&default=bsd&default=solaris&default=others" \ -d "api_key=${PMD_SF_APIKEY}" https://sourceforge.net/projects/pmd/files/pmd/${RELEASE_VERSION}/pmd-bin-${RELEASE_VERSION}.zip # 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="${RELEASE_BODY//$'\\'/\\\\}" RELEASE_BODY="${RELEASE_BODY//$'\r'/}" RELEASE_BODY="${RELEASE_BODY//$'\n'/\\r\\n}" RELEASE_BODY="${RELEASE_BODY//$'"'/\\$'"'}" cat > release-edit-request.json <