Skip to content

Commit

Permalink
[dev work] fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
8naama authored Nov 12, 2024
2 parents a5db838 + d52ac47 commit cd7d0df
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release new version to Maven

on:
release:
type: [published]
types: [published]

jobs:
publish:
Expand All @@ -15,12 +15,14 @@ jobs:
with:
java-version: 11
distribution: 'zulu'
server_id: ossrh-nexus
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_PASSWORD }}
server-id: ossrh-nexus
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Verify the pom.xml
run: mvn verify
gpg-passphrase: GPG_PASSPHRASE
- name: Publish to the Maven Central Repository
run: mvn clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: mvn deploy --batch-mode -D skipTests --activate-profiles release --no-transfer-progress
28 changes: 28 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,32 @@
</dependencies>
</dependencyManagement>

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

0 comments on commit cd7d0df

Please sign in to comment.