Skip to content

Commit c1896e5

Browse files
authored
fixing gpg signing (#367)
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
1 parent cc94a6d commit c1896e5

File tree

3 files changed

+33
-24
lines changed

3 files changed

+33
-24
lines changed

.github/workflows/maven-release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
name: Build project and publish release
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424
- name: Set up JDK 1.8
25-
uses: actions/setup-java@v1
25+
uses: actions/setup-java@v3
2626
with:
2727
java-version: 1.8
2828
server-id: ossrh-release
@@ -37,7 +37,7 @@ jobs:
3737
run: mvn -B package --file pom.xml
3838
- name: Publish to Maven central
3939
if: ${{ !endsWith(steps.project.outputs.version, '-SNAPSHOT') }}
40-
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} deploy --file pom.xml
40+
run: mvn -B deploy --file pom.xml -Pgpg-sign
4141
env:
4242
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
4343
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

.github/workflows/maven-snapshot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: echo ::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
3232
- name: Publish to snapshot repo
3333
if: ${{ endsWith(steps.project.outputs.version, '-SNAPSHOT') }}
34-
run: mvn clean --batch-mode -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} deploy
34+
run: mvn -B deploy --file pom.xml -Pgpg-sign
3535
env:
3636
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
3737
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

Java/pom.xml

+29-20
Original file line numberDiff line numberDiff line change
@@ -155,26 +155,6 @@
155155
</execution>
156156
</executions>
157157
</plugin>
158-
<plugin>
159-
<groupId>org.apache.maven.plugins</groupId>
160-
<artifactId>maven-gpg-plugin</artifactId>
161-
<version>1.6</version>
162-
<configuration>
163-
<gpgArguments>
164-
<arg>--pinentry-mode</arg>
165-
<arg>loopback</arg>
166-
</gpgArguments>
167-
</configuration>
168-
<executions>
169-
<execution>
170-
<id>sign-artifacts</id>
171-
<phase>verify</phase>
172-
<goals>
173-
<goal>sign</goal>
174-
</goals>
175-
</execution>
176-
</executions>
177-
</plugin>
178158
<plugin>
179159
<groupId>org.apache.maven.plugins</groupId>
180160
<artifactId>maven-source-plugin</artifactId>
@@ -244,4 +224,33 @@
244224
<developerConnection>scm:git:ssh://github.com/aws/random-cut-forest-by-aws.git</developerConnection>
245225
<url>https://github.com/aws/random-cut-forest-by-aws/tree/main</url>
246226
</scm>
227+
<profiles>
228+
<profile>
229+
<id>gpg-sign</id>
230+
<build>
231+
<plugins>
232+
<plugin>
233+
<groupId>org.apache.maven.plugins</groupId>
234+
<artifactId>maven-gpg-plugin</artifactId>
235+
<version>3.0.1</version>
236+
<executions>
237+
<execution>
238+
<id>sign-artifacts</id>
239+
<phase>verify</phase>
240+
<goals>
241+
<goal>sign</goal>
242+
</goals>
243+
<configuration>
244+
<gpgArguments>
245+
<arg>--pinentry-mode</arg>
246+
<arg>loopback</arg>
247+
</gpgArguments>
248+
</configuration>
249+
</execution>
250+
</executions>
251+
</plugin>
252+
</plugins>
253+
</build>
254+
</profile>
255+
</profiles>
247256
</project>

0 commit comments

Comments
 (0)