Skip to content

Commit

Permalink
Prepare for maven release (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrongestNumber9 authored Jun 8, 2023
1 parent feff42e commit 6ecb08f
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 43 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/maven-publish.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/upload_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Upload Release

on:
release:
types: published

jobs:
upload:
name: Upload
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache Local Maven Repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

- name: Setup Maven Central
uses: actions/setup-java@v2
with:
java-version: 8.0.292+10
distribution: 'adopt'

server-id: ossrh
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN

gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Maven Central
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Setup GitHub Packages
uses: actions/setup-java@v2
with:
java-version: 8.0.292+10
distribution: 'adopt'

- name: Publish to GitHub Packages
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128 changes: 119 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<artifactId>dpf_02</artifactId>
<version>${revision}${sha1}${changelist}</version>
<name>dpf_02</name>
<description>Batch Collect</description>
<url>https://teragrep.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -22,6 +23,20 @@
<developerConnection>scm:git:git@github.com:teragrep/dpf_02.git</developerConnection>
<url>https://github.com/teragrep/dpf_02/tree/master</url>
</scm>
<licenses>
<license>
<name>GNU Affero General Public License v3.0</name>
<url>https://www.gnu.org/licenses/agpl-3.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>43</name>
<email>43@teragrep.com</email>
<organization>Teragrep</organization>
<organizationUrl>https://teragrep.com</organizationUrl>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
Expand All @@ -35,7 +50,6 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.12</artifactId>
Expand All @@ -48,7 +62,6 @@
</exclusion>
</exclusions>
</dependency>

<!-- tests -->
<dependency>
<groupId>org.apache.hadoop</groupId>
Expand Down Expand Up @@ -81,10 +94,38 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<directory>${project.basedir}/target</directory>
<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.5.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<source>8</source>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
Expand Down Expand Up @@ -118,6 +159,7 @@
<exclude>.gitmodules</exclude>
<!-- ci -->
<exclude>.github/workflows/*.yml</exclude>
<exclude>.github/workflows/*.yaml</exclude>
<exclude>toolchains.xml</exclude>
<exclude>settings.xml</exclude>
<!-- readme -->
Expand Down Expand Up @@ -172,10 +214,78 @@
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/${env.GITHUB_REPOSITORY}</url>
</repository>
</distributionManagement>
<profiles>
<profile>
<id>publish-maven-central</id>
<build>
<plugins>
<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>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
<profile>
<id>publish-github-packages</id>
<build>
<plugins>
<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>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/teragrep/dpf_02</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>

0 comments on commit 6ecb08f

Please sign in to comment.