forked from lightstep/lightstep-tracer-java-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtag-and-deploy.sh
executable file
·27 lines (17 loc) · 953 Bytes
/
tag-and-deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# To publish a build, use the Makefile
# make publish
# which will call out to this script
# Use maven-help-plugin to get the current project.version
VERSION=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['`
# Tag the new version
git tag $VERSION
# Push the tag
git push --tags
echo "Publishing $VERSION"
# Build and deploy to Bintray
mvn deploy
# Sign the jar and other files in Bintray
curl -H "X-GPG-PASSPHRASE:$BINTRAY_GPG_PASSPHRASE" -u $BINTRAY_USER:$BINTRAY_API_KEY -X POST https://api.bintray.com/gpg/lightstep/maven/java-common/versions/$VERSION
# Sync the repository with Maven Central
curl -H "Content-Type: application/json" -u $BINTRAY_USER:$BINTRAY_API_KEY -X POST -d '{"username":"'$MAVEN_CENTRAL_USER_TOKEN'","password":"'$MAVEN_CENTRAL_TOKEN_PASSWORD'","close":"1"}' https://api.bintray.com/maven_central_sync/lightstep/maven/java-common/versions/$VERSION