Browse Source

GH-1246: Configuring Sonatype/Maven Central Deployment (#1334)

Configuring Circle CI to deploy to Maven Central.

* Locking Snapshot to build only on master
* All builds must pass before deploying a snapshot on master
pull/1335/head
Kevin Davis 4 years ago committed by GitHub
parent
commit
6f1b01ac54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      .circleci/config.yml
  2. 39
      .circleci/settings.xml
  3. 6
      pom.xml

41
.circleci/config.yml

@ -12,11 +12,6 @@ @@ -12,11 +12,6 @@
# the License.
#
# Java Maven CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-java/ for more details
#
# our job defaults
defaults: &defaults
working_directory: ~/feign
@ -37,6 +32,21 @@ defaults: &defaults @@ -37,6 +32,21 @@ defaults: &defaults
- run: mvn -o test
version: 2.1
commands:
configure-gpg:
steps:
- run:
name: 'Configure GPG keys'
command: |
echo -e "$GPG_KEY" | gpg --batch --no-tty --import --yes
nexus-deploy:
steps:
- run:
name: 'Deploy to Sonatype'
command: |
mvn -nsu -s .circleci/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy
jobs:
jdk8:
docker:
@ -53,6 +63,18 @@ jobs: @@ -53,6 +63,18 @@ jobs:
- image: circleci/openjdk:14-buster
<<: *defaults
deploy-snapshot:
docker:
- image: circleci/openjdk:8
steps:
- checkout
- restore_cache:
keys:
- feign-dependencies-{{ checksum "pom.xml" }}
- feign-dependencies-
- configure-gpg
- nexus-deploy
workflows:
version: 2
build:
@ -60,3 +82,12 @@ workflows: @@ -60,3 +82,12 @@ workflows:
- jdk8
- jdk11
- jdk14
- deploy-snapshot:
requires:
- jdk8
- jdk11
- jdk14
context: Sonatype
filters:
branches:
only: master

39
.circleci/settings.xml

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
<!--
Copyright 2012-2019 The Feign Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the specific language governing permissions and limitations under
the License.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.SONATYPE_USER}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>

6
pom.xml

@ -795,6 +795,12 @@ @@ -795,6 +795,12 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
<phase>verify</phase>
</execution>
</executions>

Loading…
Cancel
Save