forked from sebastianbenz/Jnario
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
48 lines (40 loc) · 2.19 KB
/
release.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
set -e
echo "release version:"
read version
#make the release build
mvn clean install -Dmaven.test.skip=true -P release
#publish update site
cd ../jnario-gh-pages
git add --all
git commit -a -m "new release $version"
git push origin gh-pages
cd ../jnario
## upload to maven central
URL="https://oss.sonatype.org/service/local/staging/deploy/maven2/"
REPO="sonatype-nexus-staging"
#todo: remove all snapshot dependencies
for project in "org.jnario.standalone.maven" "jnario-maven-plugin" "org.jnario.lib.maven"
do
cd plugins/$project
mvn versions:set -DnewVersion=$version -DgenerateBackupPoms=false
mvn clean install
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/$project-$version.jar
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/$project-$version-sources.jar -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/$project-$version-javadoc.jar -Dclassifier=javadoc
cd ../..
done
cd plugins/jnario-maven-report-plugin
mvn versions:set -DnewVersion=$version -DgenerateBackupPoms=false
mvn clean install
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/report-$version.jar
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/report-$version-sources.jar -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/report-$version-javadoc.jar -Dclassifier=javadoc
cd ../..
cd plugins/jnario-maven-archetype
mvn versions:set -DnewVersion=$version -DgenerateBackupPoms=false
mvn clean install
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/jnario-archetype-$version.jar
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/jnario-archetype-$version-sources.jar -Dclassifier=sources
cd ../..
echo "Successfully staged maven artifacts. Manually close & release via https://oss.sonatype.org/index.html#stagingRepositories"
exit 1