Skip to content

Commit

Permalink
Merge branch 'master' of github.com:unigrid-project/pax-sdk-java
Browse files Browse the repository at this point in the history
  • Loading branch information
Fim-84 committed Mar 26, 2024
2 parents a2d4628 + ddf2c0d commit 996a040
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 23 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Maven Package
name: Maven Release Package

on:
release:
Expand All @@ -8,26 +8,27 @@ on:
workflow_dispatch:

jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
server-id: ossrh # Server ID from your settings.xml
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Imported from GitHub secrets
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} # Imported from GitHub secrets

- name: Build with Maven
run: mvn -B package -DskipTests --file pom.xml
run: mvn clean install -B -P release --file pax-sdk/pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
- name: Sign and Deploy to OSSRH
run: mvn deploy -B -P release --settings pax-sdk/settings.xml --file pax-sdk/pom.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
76 changes: 64 additions & 12 deletions pax-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,32 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.unigrid</groupId>
<artifactId>pax-sdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
<packaging>jar</packaging>
<!-- Project Information -->
<name>pax-sdk</name>
<description>A Java SDK to connect to the Unigrid Cosmos SDK Network</description>
<url>https://unigrid.org</url>
<!-- Developers Information -->
<developers>
<developer>
<id>dekm</id>
<name>Evan Green</name>
<email>[email protected]</email>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<!-- MAVEN CENTRAL -->
<scm>
<url>https://github.com/unigrid-project/pax-sdk-java</url>
<connection>scm:git:git://github.com/unigrid-project/pax-sdk-java.git</connection>
<developerConnection>scm:git:ssh://github.com:unigrid-project/pax-sdk-java.git</developerConnection>
</scm>

<dependencies>
<!-- gRPC dependencies -->
<dependency>
Expand Down Expand Up @@ -93,20 +112,15 @@
<!-- MAVEN PUBLISH -->

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>github</id>
<name>GitHub Apache Maven Packages</name>
<url>https://maven.pkg.github.com/unigrid-project/pax-sdk-java</url>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<repositories>
<repository>
<id>github</id>
<name>Unigrid Cosmos SDK Java Apache Maven Packages</name>
<url>https://maven.pkg.github.com/unigrid-project/pax-sdk-java</url>
</repository>
</repositories>

<build>
<extensions>
Expand Down Expand Up @@ -828,6 +842,44 @@
<release>17</release>
</configuration>
</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.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<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>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
13 changes: 13 additions & 0 deletions pax-sdk/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- other profiles if needed -->

<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_USERNAME}</username>
<password>${env.OSSRH_PASSWORD}</password>
</server>
</servers>
</settings>

0 comments on commit 996a040

Please sign in to comment.