Skip to content

Commit

Permalink
Adding gpg and details to pom.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaytotomato committed Aug 2, 2024
1 parent d25ed44 commit 57990f4
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 30 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ jobs:
distribution: 'temurin'
java-version: '21'

- name: Import GPG Key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode | gpg --batch --import
echo "${{ secrets.GPG_KEY_ID }}" > key_id
gpg --batch --import-ownertrust < key_id
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Setup Maven Settings
uses: s4u/maven-settings-action@v3.0.0
with:
Expand All @@ -35,7 +44,7 @@ jobs:
- name: Package with Maven
run: mvn versions:set -DnewVersion=${{ env.RELEASE_VERSION }} && mvn package -DskipTests

- name: Publish to GitHub Packages
- name: Deploy Github and Maven Central
run: mvn deploy
env:
GITHUB_USERNAME: ${{ secrets.GITHUB_ACTOR }}
Expand Down
97 changes: 68 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<sonar-maven-plugin.version>4.0.0.4121</sonar-maven-plugin.version>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
<sonar.language>java</sonar.language>
<central-publishing-maven-plugin.version>0.5.0</central-publishing-maven-plugin.version>
</properties>
Expand All @@ -46,6 +47,23 @@
</license>
</licenses>

<developers>
<developer>
<id>tomaytotomato</id>
<name>Your Name</name>
<email>dev@tomaytotomato.com</email>
</developer>
</developers>

<url>https://github.com/tomaytotomato/location4j</url>

<scm>
<connection>scm:git:https://github.com/tomaytotomato/location4j.git</connection>
<developerConnection>scm:git:ssh://git@github.com:tomaytotomato/location4j.git
</developerConnection>
<url>https://github.com/tomaytotomato/location4j</url>
</scm>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -75,23 +93,6 @@
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>

<!-- Plugins !-->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</dependency>
<dependency>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -135,17 +136,55 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central-publishing-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central-publishing-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>
</plugins>

</build>
</project>

0 comments on commit 57990f4

Please sign in to comment.