Skip to content

Commit

Permalink
Merge pull request #7 from vincejv/oss-releasing
Browse files Browse the repository at this point in the history
Migrate to Maven central repository
  • Loading branch information
vincejv authored Oct 15, 2022
2 parents 7c6a6cc + 078575b commit b3c94a5
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 55 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/package-release-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Github Packages release for Development
name: Packages release for Development to Maven Central Repository

on:
push:
Expand Down Expand Up @@ -38,13 +38,15 @@ jobs:
with:
distribution: temurin
java-version: 17
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build and release to central repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn deploy
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: mvn -B deploy -Prelease-for-oss
22 changes: 12 additions & 10 deletions .github/workflows/package-release-main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Github Packages release for Production
name: Packages release for Production to Maven Central Repository

on:
push:
Expand Down Expand Up @@ -57,13 +57,15 @@ jobs:
with:
distribution: temurin
java-version: 17
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build and release to central repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn deploy -Djgitver.config=./.mvn/jgitver.main.config.xml
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: mvn -B deploy -Prelease-for-oss -Djgitver.config=./.mvn/jgitver.main.config.xml
9 changes: 2 additions & 7 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,13 @@ jobs:
with:
distribution: temurin
java-version: 17
cache: maven
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down
1 change: 1 addition & 0 deletions fpi-framework-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
</dependency>

</dependencies>

<build>
<pluginManagement>
<plugins>
Expand Down
17 changes: 1 addition & 16 deletions fpi-framework-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,10 @@

</properties>

<repositories>
<repository>
<id>github</id>
<name>Github FPI Framework Apache Maven Packages</name>
<url>https://maven.pkg.github.com/vincejv/fpi-framework</url>
</repository>
</repositories>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub FPI Framework Apache Maven Packages</name>
<url>https://maven.pkg.github.com/vincejv/fpi-framework</url>
</repository>
</distributionManagement>

<dependencies>

</dependencies>

<build>
<plugins>

Expand Down
125 changes: 113 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,37 @@
~ along with this program. If not, see <https://www.gnu.org/licenses />. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<licenses>
<license>
<name>The GNU General Public License v3.0</name>
<url>https://www.gnu.org/licenses/gpl-3.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>Vince Jerald Villamora</name>
<email>vincevillamora@gmail.com</email>
<organization>Abavilla</organization>
<organizationUrl>https://github.com/vincejv</organizationUrl>
</developer>
</developers>

<scm>
<url>https://github.com/vincejv/fpi-framework</url>
<connection>scm:git:git://github.com/vincejv/fpi-framework.git</connection>
<developerConnection>scm:git:git@github.com:vincejv/fpi-framework.git</developerConnection>
<tag>HEAD</tag>
</scm>

<name>FPI Framework</name>
<description>Reactive API backend Framework, built on top of Quarkus, for quick and easy REST API development</description>
<url>https://github.com/vincejv/fpi-framework</url>

<modelVersion>4.0.0</modelVersion>
<groupId>com.abavilla</groupId>
<artifactId>fpi-framework</artifactId>
<version>0</version> <!-- jgitver.used_version -->
<name>fpi-framework</name>
<packaging>pom</packaging>

<modules>
Expand All @@ -38,24 +57,106 @@
</modules>

<properties>
<!-- sonar properties -->
<sonar.organization>vincejv</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

<repositories>
<repository>
<id>github</id>
<name>Github FPI Framework Apache Maven Packages</name>
<url>https://maven.pkg.github.com/vincejv/fpi-framework</url>
</repository>
</repositories>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>

<!-- repository settings for deployment -->
<maven.deploy.nexus.repository-id>ossrh</maven.deploy.nexus.repository-id>
<maven.deploy.nexus.base-url>https://s01.oss.sonatype.org/</maven.deploy.nexus.base-url>
<maven.deploy.nexus.repository-url>${maven.deploy.nexus.base-url}service/local/staging/deploy/maven2</maven.deploy.nexus.repository-url>

<!-- repository settings for snapshot release -->
<maven.deploy.nexus.snapshot.repository-id>${maven.deploy.nexus.repository-id}</maven.deploy.nexus.snapshot.repository-id>
<maven.deploy.nexus.snapshot.repository-url>${maven.deploy.nexus.base-url}content/repositories/snapshots</maven.deploy.nexus.snapshot.repository-url>
</properties>

<distributionManagement>
<snapshotRepository>
<id>${maven.deploy.nexus.snapshot.repository-id}</id>
<url>${maven.deploy.nexus.snapshot.repository-url}</url>
</snapshotRepository>
<repository>
<id>github</id>
<name>Github FPI Framework Apache Maven Packages</name>
<url>https://maven.pkg.github.com/vincejv/fpi-framework</url>
<id>${maven.deploy.nexus.repository-id}</id>
<url>${maven.deploy.nexus.repository-url}</url>
</repository>
</distributionManagement>

<build>
<plugins>

</plugins>
</build>

<profiles>
<profile>
<id>release-for-oss</id>
<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</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>${maven-javadoc-plugin.version}</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>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>${maven.deploy.nexus.repository-id}</serverId>
<nexusUrl>${maven.deploy.nexus.base-url}</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>

</plugins>
</build>
</profile>
</profiles>

</project>

0 comments on commit b3c94a5

Please sign in to comment.