Skip to content

Commit 6f1b01a

Browse files
authored
OpenFeignGH-1246: Configuring Sonatype/Maven Central Deployment (OpenFeign#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
1 parent e5a922f commit 6f1b01a

3 files changed

Lines changed: 81 additions & 5 deletions

File tree

.circleci/config.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
# the License.
1313
#
1414

15-
# Java Maven CircleCI 2.0 configuration file
16-
#
17-
# Check https://circleci.com/docs/2.0/language-java/ for more details
18-
#
19-
2015
# our job defaults
2116
defaults: &defaults
2217
working_directory: ~/feign
@@ -37,6 +32,21 @@ defaults: &defaults
3732
- run: mvn -o test
3833

3934
version: 2.1
35+
36+
commands:
37+
configure-gpg:
38+
steps:
39+
- run:
40+
name: 'Configure GPG keys'
41+
command: |
42+
echo -e "$GPG_KEY" | gpg --batch --no-tty --import --yes
43+
nexus-deploy:
44+
steps:
45+
- run:
46+
name: 'Deploy to Sonatype'
47+
command: |
48+
mvn -nsu -s .circleci/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy
49+
4050
jobs:
4151
jdk8:
4252
docker:
@@ -53,10 +63,31 @@ jobs:
5363
- image: circleci/openjdk:14-buster
5464
<<: *defaults
5565

66+
deploy-snapshot:
67+
docker:
68+
- image: circleci/openjdk:8
69+
steps:
70+
- checkout
71+
- restore_cache:
72+
keys:
73+
- feign-dependencies-{{ checksum "pom.xml" }}
74+
- feign-dependencies-
75+
- configure-gpg
76+
- nexus-deploy
77+
5678
workflows:
5779
version: 2
5880
build:
5981
jobs:
6082
- jdk8
6183
- jdk11
6284
- jdk14
85+
- deploy-snapshot:
86+
requires:
87+
- jdk8
88+
- jdk11
89+
- jdk14
90+
context: Sonatype
91+
filters:
92+
branches:
93+
only: master

.circleci/settings.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!--
2+
3+
Copyright 2012-2019 The Feign Authors
4+
5+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
in compliance with the License. You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software distributed under the License
11+
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
or implied. See the License for the specific language governing permissions and limitations under
13+
the License.
14+
15+
-->
16+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
17+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
19+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
20+
<servers>
21+
<server>
22+
<id>ossrh</id>
23+
<username>${env.SONATYPE_USER}</username>
24+
<password>${env.SONATYPE_PASSWORD}</password>
25+
</server>
26+
</servers>
27+
<profiles>
28+
<profile>
29+
<id>ossrh</id>
30+
<activation>
31+
<activeByDefault>true</activeByDefault>
32+
</activation>
33+
<properties>
34+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
35+
</properties>
36+
</profile>
37+
</profiles>
38+
</settings>
39+

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,12 @@
795795
<goals>
796796
<goal>sign</goal>
797797
</goals>
798+
<configuration>
799+
<gpgArguments>
800+
<arg>--pinentry-mode</arg>
801+
<arg>loopback</arg>
802+
</gpgArguments>
803+
</configuration>
798804
<phase>verify</phase>
799805
</execution>
800806
</executions>

0 commit comments

Comments
 (0)