-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support releasing named Java versions (#454)
* Support releasing versions after the fact Support releasing named versions after main has already changed. Signed-off-by: Alex Konradi <[email protected]> * Update Java releasing instructions Signed-off-by: Alex Konradi <[email protected]> * Fix bash syntax Signed-off-by: Alex Konradi <[email protected]>
- Loading branch information
Showing
2 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,15 +28,23 @@ jobs: | |
fingerprints: | ||
- "cd:a8:80:f3:5e:9a:37:30:ef:55:20:b5:1f:b9:e5:18" | ||
- deploy: | ||
command: | # Deploy if on main branch. If the $RELEASE and $NEXT variables are set then prepare a full maven release. | ||
if [ "${CIRCLE_BRANCH}" == "main" ]; then | ||
command: | # Deploy from the main branch or from a version branch/tag. If the $RELEASE and $NEXT variables are set then prepare a full maven release. | ||
if [[ "${CIRCLE_BRANCH}" =~ v[0-9]+\.[0-9]+\.[0-9]+ ]]; then | ||
RELEASE="${CIRCLE_BRANCH}" | ||
NEXT="${CIRCLE_BRANCH}-SNAPSHOT" | ||
DO_RELEASE=1 | ||
fi | ||
if [[ "${CIRCLE_BRANCH}" == "main" || -n "${DO_RELEASE}" ]]; then | ||
echo $GPG_KEY | base64 --decode > signing-key | ||
gpg --passphrase $GPG_PASSPHRASE --import signing-key | ||
shred signing-key | ||
if [[ -n "${RELEASE}" && -n "${NEXT}" ]]; then | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "envoy-bot" | ||
mvn -B -s ../.circleci/settings.xml release:prepare release:perform -Darguments="-s ../.circleci/settings.xml" -DreleaseVersion=$RELEASE -DdevelopmentVersion=$NEXT -DscmCommentPrefix="java release: " | ||
mvn -B -s ../.circleci/settings.xml release:prepare release:perform \ | ||
-Darguments="-s ../.circleci/settings.xml" \ | ||
-DreleaseVersion=$RELEASE -DdevelopmentVersion=$NEXT \ | ||
-DscmCommentPrefix="java release: " | ||
else | ||
mvn -B -s ../.circleci/settings.xml deploy | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,9 @@ These steps are for releasing the Java components of PGV: | |
- pgv-java-grpc | ||
- pgv-artifacts | ||
|
||
## Releasing from master using CI | ||
## Releasing using CI | ||
|
||
Releasing from master is fully automated by CI, but can't release historic tags. | ||
Releasing from main is fully automated by CI: | ||
``` | ||
curl -X POST -H "Content-Type: application/json" -d '{ | ||
"build_parameters": { | ||
|
@@ -16,9 +16,24 @@ curl -X POST -H "Content-Type: application/json" -d '{ | |
"NEXT": "<next-version>-SNAPSHOT", | ||
"GIT_USER_EMAIL": "[email protected]", | ||
"GIT_USER_NAME": "Via CircleCI" | ||
}}' "https://circleci.com/api/v1.1/project/github/envoyproxy/protoc-gen-validate/tree/master?circle-token=<my-token>" | ||
}}' "https://circleci.com/api/v1.1/project/github/envoyproxy/protoc-gen-validate/tree/main?circle-token=<my-token>" | ||
``` | ||
|
||
Releasing from versioned tags is similar. To release version `vX.Y.Z`, first | ||
create a Git tag called `vX.Y.Z` (preferably through the GitHub release flow), | ||
then run the following to kick off a release build: | ||
``` | ||
curl -X POST -H "Content-Type: application/json" -d '{ | ||
"build_parameters": { | ||
"CIRCLE_JOB": "javabuild", | ||
"GIT_USER_EMAIL": "[email protected]", | ||
"GIT_USER_NAME": "Via CircleCI" | ||
}}' "https://circleci.com/api/v1.1/project/github/envoyproxy/protoc-gen-validate/tree/v.X.Y.Z?circle-token=<my-token>" | ||
``` | ||
|
||
The `javabuild` CI flow will use the version number from the tag to deploy to | ||
the Maven repository. | ||
|
||
## Manually releasing from git history | ||
|
||
Manually releasing from git history is a more involved process, but allows you | ||
|
@@ -34,4 +49,4 @@ to release from any point in the history. | |
|
||
``` | ||
mvn -B -s /path/to/settings.xml clean release:prepare release:perform -Darguments="-s /path/to/settings.xml" -DreleaseVersion=x.y.z -DdevelopmentVersion=x.y.z-SNAPSHOT -DscmCommentPrefix="java release: " | ||
``` | ||
``` |