Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dengliming committed Sep 29, 2024
1 parent 740d108 commit 2729e93
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/version-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
uses: actions/checkout@v4

- name: Set up Java with Maven cache

uses: actions/setup-java@v4
with:
java-version: '8'
Expand All @@ -30,18 +29,16 @@ jobs:
if: ${{ github.event.release.tag_name }}

- name: Install GPG key

run: |
cat <(echo -e "${{ secrets.OSSH_GPG_SECRET_KEY }}") | gpg --batch --import
cat <(echo -e "${{ secrets.GPG_SECRET }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Publish to Maven

run: |
mvn --no-transfer-progress \
--batch-mode \
-Dgpg.passphrase='${{ secrets.OSSH_GPG_SECRET_KEY_PASSWORD }}' \
-DskipTests deploy
-Dgpg.passphrase='${{ secrets.GPG_PASSWORD }}' \
-DskipTests deploy -P sonatype-oss-release
env:
MAVEN_USERNAME: ${{secrets.OSSRH_USER}}
Expand Down
45 changes: 30 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,24 +286,39 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>sonatype-oss-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${gpg-plugin.version}</version>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<distributionManagement>
<snapshotRepository>
<id>oss</id>
Expand Down

0 comments on commit 2729e93

Please sign in to comment.