Release process docs (#248)

* Doc of the new release process using GH actions and cleanup of the old release scripts

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Nit

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
This commit is contained in:
Francesco Guardiani 2020-09-29 13:35:57 +02:00 committed by GitHub
parent 3cea0245b3
commit f219b6937c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 120 deletions

View File

@ -20,7 +20,7 @@ jobs:
java-version: ${{ matrix.java }}
- run: |
mvn clean install -DskipTests -B
mvn verify
mvn verify -B
deploy:
runs-on: ubuntu-latest
name: Deploy

View File

@ -20,4 +20,4 @@ jobs:
java-version: ${{ matrix.java }}
- run: |
mvn clean install -DskipTests -B
mvn verify
mvn verify -B

View File

@ -1,5 +1,17 @@
# Maintainer's Guide
## Release Process
The release process is automated with Github actions. In order to perform a release:
1. Check if master CI pass.
1. Open the Github repository main page and go in the tab "Actions". Trigger the workflow "Bump version" and insert the new version to release. This will create a new release PR.
1. Check the release PR, merge it and cleanup the created branch.
1. Wait for the CI to complete the deploy of the modules to OSSRH.
1. Using the Github UI, create a new release, specifying the release notes and the tag to use.
1. Trigger again the workflow "Bump version" to bump versions back to a snapshot version.
1. Check the snapshot release PR, merge it and cleanup the created branch.
## Tips
Here are a few tips for repository maintainers.

View File

@ -1,24 +0,0 @@
# Release process
The release is automatically performed by Travis CI.
In order to trigger it, you can use the script `trigger_release.sh` like:
```bash
./scripts/trigger_release.sh --release 2.0.0-milestone2 --snapshot 2.1.0-SNAPSHOT --upstream origin
```
This script will:
- Perform a dump of the release using the release version
- Update all the \*.md containing the release version
- Tag and commit all the above changes and eventually push them to the
provided remote
- Perform a dump of the version back to the provided snapshot version
- Commit all the above changes and eventually push them to the provided remote
After the script performed all the changes, you can create the new release on
GitHub: https://github.com/cloudevents/sdk-java/releases/new
Note: Before running it pointing to upstream/master, try always in your local
repo

View File

@ -1,94 +0,0 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
function die() { echo "$*" 1>&2 ; exit 1; }
# Example usage
# ./scripts/trigger_release.sh --upstream upstream --release 2.0.0 --snapshot 2.1.0-SNAPSHOT
# In order to start the release the script:
# * Performs a dump of the release using the release version
# * Updates all the *.md containing the release version
# * Commits all the above changes and eventually push them to the provided remote
# * Performs a dump of the version back to the provided snapshot version
# * Commits all the above changes and eventually push them to the provided remote
THIS_BRANCH=$(git rev-parse --abbrev-ref HEAD)
REMOTE=""
NEW_SNAPSHOT=""
NEW_VERSION=""
# Loop through arguments and process them
while (( "$#" )); do
case $1 in
-u|--upstream)
if [[ -n $2 ]]; then
REMOTE=$2
shift
else
die 'ERROR: "--upstream" requires a non-empty option argument.'
fi
;;
-r|--release)
if [[ -n $2 ]]; then
NEW_VERSION=$2
shift
else
die 'ERROR: "--version" requires a non-empty option argument.'
fi
;;
-s|--snapshot)
if [[ -n $2 ]]; then
NEW_SNAPSHOT=$2
shift
else
die 'ERROR: "--snapshot" requires a non-empty option argument.'
fi
;;
esac
shift
done
if [ -z "$REMOTE" ]; then
echo "Remote is not specified, I'm gonna perform the changes only locally"
else
echo "Going to release on remote $REMOTE"
fi
if [ -z "$NEW_VERSION" ]; then
die 'ERROR: version is not specified'
fi
if [ -z "$NEW_SNAPSHOT" ]; then
die 'ERROR: new snapshot is not specified'
fi
echo "Dumping to release $NEW_VERSION"
mvn versions:set -DnewVersion="$NEW_VERSION"
find . -name "pom.xml" -exec git add {} \;
sed -i -e "s+<version>[a-zA-Z0-9.-]*<\/version>+<version>$NEW_VERSION</version>+g" ***/*.md
find . -name "*.md" -exec git add {} \;
git commit --signoff -m "Release $NEW_VERSION"
git tag $NEW_VERSION
if [ -n "$REMOTE" ]; then
git push --follow-tags -u $REMOTE $THIS_BRANCH
fi
echo "Dumping to snapshot $NEW_SNAPSHOT"
mvn versions:set -DnewVersion="$NEW_SNAPSHOT"
find . -name "pom.xml" -exec git add {} \;
git commit --signoff -m "Release $NEW_SNAPSHOT"
if [ -n "$REMOTE" ]; then
git push -u $REMOTE $THIS_BRANCH
fi
echo "Done! Now you can create the release on GitHub!"