Skip to content

Commit 4003f9a

Browse files
committed
Fix missing gpg sign and add correct maven deploy flow
1 parent 8845384 commit 4003f9a

File tree

2 files changed

+14
-41
lines changed

2 files changed

+14
-41
lines changed

.github/workflows/build_deploy.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,21 @@ jobs:
4444
java-version: '11'
4545
distribution: 'adopt'
4646
cache: 'maven'
47-
server-id: ossrh
48-
server-username: MAVEN_USERNAME
49-
server-password: MAVEN_PASSWORD
47+
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
48+
server-username: MAVEN_USERNAME # env variable for username in deploy
49+
server-password: MAVEN_PASSWORD # env variable for token in deploy
50+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
51+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
5052
- name: Publish package
51-
run: mvn -B deploy -DskipTests
53+
run: |
54+
./mvnw -B verify nexus-staging:deploy -P deploy && \
55+
./mvnw -B nexus-staging:release -P deploy
5256
env:
5357
OPENSOURCE_PROJECTS_KS_PW: ${{ secrets.KEYSTORE_PASSWORD }}
5458
OPENSOURCE_PROJECTS_KEY_PW: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
5559
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
5660
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
61+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
5762
- name: Create and upload Github Release
5863
uses: xresloader/upload-to-github-release@v1
5964
env:

pom.xml

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>at.favre.lib</groupId>
99
<artifactId>common-parent</artifactId>
10-
<version>15</version>
10+
<version>18</version>
1111
</parent>
1212

1313
<artifactId>hkdf</artifactId>
@@ -23,28 +23,6 @@
2323
<url>https://github.com/patrickfav/hkdf</url>
2424
<inceptionYear>2017</inceptionYear>
2525

26-
<repositories>
27-
<repository>
28-
<id>central</id>
29-
<name>Maven Central</name>
30-
<url>https://repo1.maven.org/maven2</url>
31-
<snapshots>
32-
<enabled>false</enabled>
33-
</snapshots>
34-
</repository>
35-
</repositories>
36-
37-
<pluginRepositories>
38-
<pluginRepository>
39-
<id>central</id>
40-
<name>Maven Central</name>
41-
<url>https://repo1.maven.org/maven2</url>
42-
<snapshots>
43-
<enabled>false</enabled>
44-
</snapshots>
45-
</pluginRepository>
46-
</pluginRepositories>
47-
4826
<build>
4927
<plugins>
5028
<plugin>
@@ -121,7 +99,6 @@
12199
<dependency>
122100
<groupId>junit</groupId>
123101
<artifactId>junit</artifactId>
124-
<version>4.13.2</version>
125102
<scope>test</scope>
126103
</dependency>
127104
<dependency>
@@ -143,18 +120,9 @@
143120
</dependency>
144121
</dependencies>
145122

146-
<distributionManagement>
147-
<repository>
148-
<id>ossrh</id>
149-
<name>Central Repository OSSRH</name>
150-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
151-
</repository>
152-
</distributionManagement>
153-
154123
<scm>
155-
<connection>https://github.com/patrickfav/hkdf.git</connection>
156-
<developerConnection>https://github.com/patrickfav/hkdf.git</developerConnection>
157-
<tag>HEAD</tag>
124+
<connection>scm:git:https://github.com/patrickfav/hkdf.git</connection>
125+
<developerConnection>scm:git:https://github.com/patrickfav/hkdf.git</developerConnection>
158126
<url>https://github.com/patrickfav/hkdf</url>
159127
</scm>
160128

@@ -164,7 +132,7 @@
164132
</issueManagement>
165133

166134
<ciManagement>
167-
<system>Travis</system>
168-
<url>https://travis-ci.com/patrickfav/hkdf</url>
135+
<system>Github Actions</system>
136+
<url>https://github.com/patrickfav/hkdf/actions</url>
169137
</ciManagement>
170138
</project>

0 commit comments

Comments
 (0)