Skip to content

Commit

Permalink
Merge pull request #21 from majusko/feature/maven-central-release
Browse files Browse the repository at this point in the history
Added support for maven central release.
  • Loading branch information
majusko authored Sep 22, 2020
2 parents bbd8444 + b898549 commit c1b893b
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ build/
.vscode/

#Mac
.DS_Store
.DS_Store

my-settings.xml
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ jdk:
dist: trusty
after_success:
- bash <(curl -s https://codecov.io/bash)
- "[[ $TRAVIS_BRANCH == \"master\" ]] && { mvn deploy --settings travis-settings.xml -DskipTests=true -B; };"
before_deploy:
- "mvn -DskipTests package"
- export FILE_TO_UPLOAD=$(ls target/grpc-apm-spring-boot-starter-*.jar)
Expand Down
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Spring boot starter for [gRPC framework](https://grpc.io/) with [Elastic APM tracer](https://www.elastic.co/products/apm)

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.majusko/grpc-apm-spring-boot-starter/badge.svg)](https://search.maven.org/search?q=g:io.github.majusko)
[![Release](https://jitpack.io/v/majusko/grpc-apm-spring-boot-starter.svg)](https://jitpack.io/#majusko/grpc-apm-spring-boot-starter)
[![Build Status](https://travis-ci.com/majusko/grpc-apm-spring-boot-starter.svg?branch=master)](https://travis-ci.com/majusko/grpc-apm-spring-boot-starter)
[![Test Coverage](https://codecov.io/gh/majusko/grpc-apm-spring-boot-starter/branch/master/graph/badge.svg)](https://codecov.io/gh/majusko/grpc-apm-spring-boot-starter/branch/master)
Expand All @@ -16,15 +17,6 @@ Quick start consist only from 2 simple steps.

#### 1. Add Maven dependency

```xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
```

```xml
<dependency>
<groupId>io.github.majusko</groupId>
Expand Down
27 changes: 27 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Release process

### 1. On some machines you need to run this first

Because of: https://github.com/keybase/keybase-issues/issues/2798

```yaml
export GPG_TTY=$(tty)
```

### 2. Prepare your `my-settings.xml`

```xml
<servers>
<server>
<id>ossrh</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
```

### 3. Execute release command

```yaml
mvn clean deploy -P release-sign-artifacts --settings my-settings.xml
```
71 changes: 70 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>io.github.majusko</groupId>
<artifactId>grpc-apm-spring-boot-starter</artifactId>
<version>1.0.4-SNAPSHOT</version>
<version>1.0.4</version>
<name>grpc-apm-spring-boot-starter</name>
<description>Elastic APM Tracer for your Grpc Spring Boot project</description>

Expand Down Expand Up @@ -95,6 +95,64 @@

</dependencies>

<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<detectJavaApiLink>false</detectJavaApiLink>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>

<extensions>
Expand Down Expand Up @@ -191,4 +249,15 @@
<organizationUrl>https://github.com/majusko</organizationUrl>
</developer>
</developers>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
12 changes: 12 additions & 0 deletions travis-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<!-- Maven Central Deployment -->
<id>ossrh</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
</settings>

0 comments on commit c1b893b

Please sign in to comment.