Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: Release
on:
pull_request:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
release_tag:
description: 'v1.0.8-oss'
required: true


jobs:
publish:
Expand All @@ -13,30 +19,33 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "v1.0.8-oss"
# ref: ${{ github.event.inputs.release_tag }}

- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
with:
java-version: 11
server-id: ossrh
server-id: central
distribution: "adopt"
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Publish to the Maven Central Repository
run: mvn -Prelease --batch-mode deploy -Dnvd.api.key=${{ secrets.NVD_API_KEY }}
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: target/*.jar
# - name: Create GitHub release
# uses: softprops/action-gh-release@v1
# with:
# files: target/*.jar
151 changes: 61 additions & 90 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -609,109 +609,80 @@
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<doclint>none</doclint>
<sourcepath>${project.build.sourceDirectory}:${project.build.directory}/generated-sources/annotations</sourcepath>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<doclint>none</doclint>
<sourcepath>${project.build.sourceDirectory}:${project.build.directory}/generated-sources/annotations</sourcepath>
</configuration>
<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>
<configuration>
<!-- Prevent gpg from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
<!-- Custom reduced pom file for fat jar -->
<pomFile>${project.basedir}/uber-minimal-pom.xml</pomFile>
<sources>${project.build.directory}/${project.build.finalName}-sources.jar</sources>
<javadoc>${project.build.directory}/${project.build.finalName}-javadoc.jar</javadoc>
<files>${project.build.directory}/${project.build.finalName}-thin.jar</files>
<types>jar</types>
<classifiers>thin</classifiers>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<goals>
<!-- Refer: https://maven.apache.org/plugins/maven-gpg-plugin/sign-and-deploy-file-mojo.html -->
<goal>sign-and-deploy-file</goal>
<goal>sign</goal>
</goals>
<phase>deploy</phase>
<configuration>
<file>${project.build.directory}/${project.build.finalName}.jar</file>
<repositoryId>ossrh</repositoryId>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<!-- Prevent gpg from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
<!-- Custom reduced pom file for fat jar -->
<pomFile>${project.basedir}/uber-minimal-pom.xml</pomFile>
<sources>${project.build.directory}/${project.build.finalName}-sources.jar</sources>
<javadoc>${project.build.directory}/${project.build.finalName}-javadoc.jar</javadoc>
<files>${project.build.directory}/${project.build.finalName}-thin.jar</files>
<types>jar</types>
<classifiers>thin</classifiers>
</configuration>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<skip>true</skip>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.sonatype.plugins</groupId>-->
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
<!-- <version>1.6.13</version>-->
<!-- <extensions>true</extensions>-->
<!-- <configuration>-->
<!-- <serverId>ossrh</serverId>-->
<!-- <nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>-->
<!-- <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>nexus-deploy</id>-->
<!-- <phase>deploy</phase>-->
<!-- <goals>-->
<!-- <goal>close</goal>-->
<!-- <goal>release</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
</plugins>
</build>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</plugins>
</build>
</profile>
</profiles>
</project>
4 changes: 2 additions & 2 deletions uber-minimal-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
</issueManagement>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>central</id>
<url>https://central.sonatype.com/api/v1/publisher</url>
</repository>
</distributionManagement>
</project>
Loading