Skip to content

Commit 828006d

Browse files
authored
Merge pull request #231 from zalando/publish-action
github action to publish to Sonatype Central
2 parents 97378f0 + 0942b8c commit 828006d

File tree

7 files changed

+29
-60
lines changed

7 files changed

+29
-60
lines changed

.github/workflows/maven-build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ jobs:
2424
fetch-depth: 0
2525

2626
- name: Set up JDK 17
27-
uses: actions/setup-java@v4
27+
uses: actions/setup-java@v5
2828
with:
2929
java-version: '17'
3030
distribution: 'temurin'
3131
cache: maven
3232

3333
- name: Cache Maven packages
34-
uses: actions/cache@v3
34+
uses: actions/cache@v4
3535
with:
3636
path: ~/.m2/repository
3737
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
38+
restore-keys: |
39+
${{ runner.os }}-maven-
3840
3941
- name: Build with Maven
4042
env:

.github/workflows/maven-publish.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,19 @@ jobs:
1111
- uses: actions/checkout@v5
1212

1313
- name: Setup JDK
14-
uses: actions/setup-java@v4
14+
uses: actions/setup-java@v5
1515
with:
1616
java-version: 17
1717
distribution: 'temurin'
1818
server-id: central
19-
server-username: SONATYPE_USERNAME
20-
server-password: SONATYPE_PASSWORD
21-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
22-
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
23-
24-
- name: Build with Maven
25-
run: ./mvnw -B verify
19+
server-username: SONATYPE_USERNAME # env variable for username in deploy
20+
server-password: SONATYPE_PASSWORD # env variable for token in deploy
21+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # value of GPG private key
22+
gpg-passphrase: SONATYPE_GPG_PASSPHRASE # env variable for GPG private key passphrase
2623

2724
- name: Publish to Sonatype Central
28-
run: ./mwnw -B -Psonatype deploy
25+
run: ./mvnw -e -B -Psonatype deploy
2926
env:
30-
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
31-
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
32-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
27+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
28+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
29+
SONATYPE_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

pom.xml

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>org.zalando.awspring.cloud</groupId>
1414
<artifactId>zalando-cloud-aws</artifactId>
15-
<version>3.3.2-SNAPSHOT</version>
15+
<version>3.3.3-SNAPSHOT</version>
1616
<packaging>pom</packaging>
1717

1818
<name>Zalando Cloud AWS</name>
@@ -56,13 +56,18 @@
5656

5757
<distributionManagement>
5858
<downloadUrl>https://github.com/zalando/spring-cloud-config-aws-kms</downloadUrl>
59-
<!--
59+
6060
<repository>
61-
<id>github</id>
62-
<name> GitHub Packages</name>
63-
<url>https://maven.pkg.github.com/zalando/spring-cloud-config-aws-kms</url>
61+
<id>central</id>
62+
<name>Sonatype Central</name>
63+
<url>https://central.sonatype.com</url>
6464
</repository>
65-
-->
65+
<snapshotRepository>
66+
<id>sonatype-nexus-snapshots</id>
67+
<name>Sonatype Nexus Snapshots</name>
68+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
69+
</snapshotRepository>
70+
6671
<site>
6772
<id>zalando-cloud-aws-docs</id>
6873
<url>https://github.com/zalando/spring-cloud-config-aws-kms</url>
@@ -103,35 +108,9 @@
103108

104109
<profiles>
105110
<profile>
106-
<id>release</id>
111+
<id>sonatype</id>
107112
<build>
108113
<plugins>
109-
<plugin>
110-
<groupId>org.apache.maven.plugins</groupId>
111-
<artifactId>maven-source-plugin</artifactId>
112-
<version>3.2.1</version>
113-
<executions>
114-
<execution>
115-
<id>attach-sources</id>
116-
<goals>
117-
<goal>jar-no-fork</goal>
118-
</goals>
119-
</execution>
120-
</executions>
121-
</plugin>
122-
<plugin>
123-
<groupId>org.apache.maven.plugins</groupId>
124-
<artifactId>maven-javadoc-plugin</artifactId>
125-
<version>3.5.0</version>
126-
<executions>
127-
<execution>
128-
<id>attach-javadocs</id>
129-
<goals>
130-
<goal>jar</goal>
131-
</goals>
132-
</execution>
133-
</executions>
134-
</plugin>
135114
<plugin>
136115
<groupId>org.apache.maven.plugins</groupId>
137116
<artifactId>maven-gpg-plugin</artifactId>
@@ -145,15 +124,6 @@
145124
</goals>
146125
</execution>
147126
</executions>
148-
<configuration>
149-
<!-- Prevents GPG from using interactive PIN entry programs -->
150-
<gpgArguments>
151-
<arg>--pinentry-mode</arg>
152-
<arg>loopback</arg>
153-
</gpgArguments>
154-
<!-- Passphrase comes from GPG_PASSPHRASE env variable via GitHub secrets -->
155-
<passphraseServerId>${env.GPG_PASSPHRASE}</passphraseServerId>
156-
</configuration>
157127
</plugin>
158128

159129
<plugin>

zalando-cloud-aws-autoconfigure/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.zalando.awspring.cloud</groupId>
88
<artifactId>zalando-cloud-aws</artifactId>
9-
<version>3.3.2-SNAPSHOT</version>
9+
<version>3.3.3-SNAPSHOT</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

zalando-cloud-aws-kms/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.zalando.awspring.cloud</groupId>
88
<artifactId>zalando-cloud-aws</artifactId>
9-
<version>3.3.2-SNAPSHOT</version>
9+
<version>3.3.3-SNAPSHOT</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

zalando-cloud-aws-samples/zalando-cloud-aws-kms-sample/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>org.zalando.awspring.cloud</groupId>
1414
<artifactId>zalando-cloud-aws-kms-sample</artifactId>
15-
<version>3.3.2-SNAPSHOT</version>
15+
<version>3.3.3-SNAPSHOT</version>
1616
<packaging>jar</packaging>
1717
<name>Zalando Cloud AWS KMS Sample</name>
1818

zalando-cloud-aws-starters/zalando-cloud-aws-starter-kms/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>zalando-cloud-aws</artifactId>
77
<groupId>org.zalando.awspring.cloud</groupId>
8-
<version>3.3.2-SNAPSHOT</version>
8+
<version>3.3.3-SNAPSHOT</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111

0 commit comments

Comments
 (0)