Skip to content

Commit

Permalink
Automate deployment to OSSRH/Docker Hub (#258)
Browse files Browse the repository at this point in the history
* Add Javadoc and Source mojos for release profile

Update release profile to generate source and javadoc jars for the
project.

* Change distribution management to OSSRH

* Add maven-gpg-plugin

Add maven-gpg-plugin:sign goal to the release profile

* Add extra project information

* Fix spark3 dependencies

* Add missing description

* Switch to OSSRH/Docker Hub for packages

* fixing pr maven cache

* Add javadoc execution to pull requests
  • Loading branch information
laurentgo authored Oct 3, 2020
1 parent 3624b89 commit 5c8d430
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 16 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 11
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_OSSRH_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/com/nessie
!~/.m2/repository/org/projectnessie
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
Expand All @@ -34,14 +40,16 @@ jobs:
- name: Build with Maven
run: mvn -B deploy --file pom.xml -Pcode-coverage,native,release -DdeployAtEnd=true
env:
GITHUB_TOKEN: ${{ github.token }}
MAVEN_USERNAME: ${{ secrets.OSSRH_ACCESS_ID }}
MAVEN_OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Push Docker images
run: |
echo '${{ secrets.GITHUB_TOKEN }}' | docker login https://docker.pkg.github.com -u '${{ github.actor }}' --password-stdin
echo '${{ secrets.DOCKER_TOKEN }}' | docker login https://docker.pkg.github.com -u 'nessiebuilder' --password-stdin
docker images --filter 'reference=projectnessie/nessie' --format '{{.ID}}\t{{.Tag}}' |
while read IMAGE_ID IMAGE_TAG; do
docker tag "$IMAGE_ID" "docker.pkg.github.com/${{ github.repository }}/nessie:${IMAGE_TAG}"
docker push "docker.pkg.github.com/${{ github.repository }}/nessie:${IMAGE_TAG}"
docker tag "$IMAGE_ID" "projectnessie/nessie-unstable:${IMAGE_TAG%-snapshot}"
docker push "projectnessie/nessie-unstable:${IMAGE_TAG%-snapshot}"
done
- name: Capture test results
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -119,5 +127,5 @@ jobs:
external_repository: projectnessie/projectnessie.github.io
publish_branch: main
deploy_key: ${{ secrets.NESSIE_SITE_DEPLOY_KEY }}
publish_dir: ./site/site
publish_dir: ./site/site
cname: projectnessie.org
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
path: |
~/.m2/repository
!~/.m2/repository/com/nessie
!~/.m2/repository/org/projectnessie
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
Expand All @@ -36,7 +36,7 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Build with Maven
run: mvn -B install --file pom.xml -Pcode-coverage
run: mvn -B install javadoc:javadoc-no-fork --file pom.xml -Pcode-coverage
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Run Hive tests with JDK8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.fasterxml.jackson.databind.SerializationFeature;

/**
* custom resolver for ObjectMapper to enable optional settings on json <-> object conversion.
* custom resolver for ObjectMapper to enable optional settings on json &lt;-&gt; object conversion.
*/
@Provider
public class ObjectMapperContextResolver implements ContextResolver<ObjectMapper> {
Expand Down
32 changes: 32 additions & 0 deletions clients/deltalake/spark2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,36 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>default-javadocJar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<id>default-javadocJar</id>
<goals>
<goal>doc-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
36 changes: 34 additions & 2 deletions clients/deltalake/spark3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>nessie-deltalake</includeArtifactIds>
<includeArtifactIds>nessie-deltalake-core</includeArtifactIds>
<classifier>sources</classifier>
<failOnMissingClassifierArtifact>true</failOnMissingClassifierArtifact>
<outputDirectory>${project.build.directory}/sources</outputDirectory>
Expand All @@ -177,7 +177,7 @@
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>nessie-deltalake</includeArtifactIds>
<includeArtifactIds>nessie-deltalake-core</includeArtifactIds>
<classifier>test-sources</classifier>
<failOnMissingClassifierArtifact>true</failOnMissingClassifierArtifact>
<outputDirectory>${project.build.directory}/test-sources</outputDirectory>
Expand Down Expand Up @@ -321,4 +321,36 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>default-javadocJar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<id>default-javadocJar</id>
<goals>
<goal>doc-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.dremio.nessie.model;

/**
* wrap object with a version id. For eTag & Match-If
* wrap object with a version id. For eTag &amp; Match-If
*/
public class VersionedWrapper<T> {

Expand Down
109 changes: 106 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,54 @@
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Nessie</name>
<description>Data Ops for Data Lakes</description>
<url>https://projectnessie.org</url>
<organization>
<name>Project Nessie</name>
<url>https://projectnessie.org</url>
</organization>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<id>jacques-n</id>
<name>Jacques Nadeau</name>
<url>https://github.com/jacques-n</url>
</developer>
<developer>
<id>rymurr</id>
<name>Ryan Murray</name>
<url>https://github.com/rymurr</url>
</developer>
<developer>
<id>laurentgo</id>
<name>Laurent Goujon</name>
<url>https://github.com/laurentgo</url>
</developer>
</developers>
<contributors>
<contributor>
<name>Ryan Tse</name>
<url>https://github.com/ryantse</url>
</contributor>
</contributors>

<mailingLists>
<mailingList>
<name>Project Nessie List</name>
<subscribe>[email protected]</subscribe>
<unsubscribe>[email protected]</unsubscribe>
<post>[email protected]</post>
<archive>https://groups.google.com/g/projectnessie</archive>
</mailingList>
</mailingLists>

<modules>
<module>model</module>
<module>backends</module>
Expand All @@ -41,11 +89,18 @@
<url>https://github.com/projectnessie/nessie/tree/${project.scm.tag}</url>
<tag>main</tag>
</scm>
<issueManagement>
<system>Github</system>
<url>https://github.com/projectnessie/nessie/issues</url>
</issueManagement>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>github</id>
<name>GitHub Nessie Apache Maven Packages</name>
<url>https://maven.pkg.github.com/projectnessie/nessie</url>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

Expand Down Expand Up @@ -508,6 +563,11 @@
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
</plugin>

<!-- 3rd party plugins -->
<plugin>
Expand Down Expand Up @@ -1031,5 +1091,48 @@ limitations under the License.
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>default-soucesJar</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>default-javadocJar</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>default-sign</id>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.google.protobuf.ByteString;

/**
* Used to serialize & deserialize the values in the store. Provided to an implementation of VersionStore on construction.
* Used to serialize &amp; deserialize the values in the store. Provided to an implementation of VersionStore on construction.
*/
public interface Serializer<V> {

Expand Down

0 comments on commit 5c8d430

Please sign in to comment.