Ossrh profile should be explicitly enabled

Fixes GPG issue building #31

Signed-off-by: Cédric Couralet <cedric.couralet@insee.fr>
This commit is contained in:
Cédric Couralet 2021-08-02 08:30:28 +02:00 committed by Cédric Couralet
parent 02f043d077
commit de5a741be1
2 changed files with 51 additions and 50 deletions

View File

@ -17,8 +17,8 @@ jobs:
- id: install-secret-key - id: install-secret-key
name: Install gpg secret key name: Install gpg secret key
run: | run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_KEY }}") | gpg --batch --import cat <(echo -e "${{ secrets.OSSRH_GPG_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG gpg --list-secret-keys --keyid-format LONG
- id: publish-to-central - id: publish-to-central
name: Publish to Central Repository name: Publish to Central Repository
env: env:
@ -30,6 +30,7 @@ jobs:
--no-transfer-progress \ --no-transfer-progress \
--batch-mode \ --batch-mode \
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_KEY_PASSWORD }} \ -Dgpg.passphrase=${{ secrets.OSSRH_GPG_KEY_PASSWORD }} \
-P ossrh \
clean deploy clean deploy
- id: push-new-version - id: push-new-version
name: push new version name: push new version

92
pom.xml
View File

@ -102,51 +102,51 @@
</build> </build>
<profiles> <profiles>
<profile> <profile>
<id>ossrh</id> <id>ossrh</id>
<activation> <activation>
<activeByDefault>true</activeByDefault> <activeByDefault>false</activeByDefault>
</activation> </activation>
<properties> <properties>
<gpg.executable>gpg</gpg.executable> <gpg.executable>gpg</gpg.executable>
<!-- <gpg.passphrase>${env.GPG_PASSWORD}</gpg.passphrase> --> <!-- <gpg.passphrase>${env.GPG_PASSWORD}</gpg.passphrase> -->
</properties> </properties>
<distributionManagement> <distributionManagement>
<snapshotRepository> <snapshotRepository>
<id>ossrh</id> <id>ossrh</id>
<name>Central Repository OSSRH</name> <name>Central Repository OSSRH</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository> </snapshotRepository>
<repository> <repository>
<id>ossrh</id> <id>ossrh</id>
<name>Central Repository OSSRH</name> <name>Central Repository OSSRH</name>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url> <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository> </repository>
</distributionManagement> </distributionManagement>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version> <version>3.0.1</version>
<executions> <executions>
<execution> <execution>
<id>sign-artifacts</id> <id>sign-artifacts</id>
<phase>verify</phase> <phase>verify</phase>
<goals> <goals>
<goal>sign</goal> <goal>sign</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
<configuration> <configuration>
<gpgArguments> <gpgArguments>
<arg>--pinentry-mode</arg> <arg>--pinentry-mode</arg>
<arg>loopback</arg> <arg>loopback</arg>
</gpgArguments> </gpgArguments>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</profile> </profile>
</profiles> </profiles>
</project> </project>