Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java][CI]: Publish Java packages to artifactory server #98

Conversation

davisusanibar
Copy link
Contributor

@davisusanibar davisusanibar commented Oct 27, 2022

Related to #43

This PR use the same proposal that Substrait use for release process + Maven publish Java artifacts

Pre activities:

  • To deploy to Github packages repository:
    Setup Personal access tokens (classic) GITHUB_TOKEN (token with repo, write:packages access)

  • To deploy to Archiva / Nexus / Other:
    Setup repository secret for NEXUS_USERNAME
    Setup repository secret for NEXUS_PASSWORD

  • For semantic-release:
    By default we could start with 1.0.0-SNAPSHOT (if not, is needed to create tag 0.0.0 and release process will use semantic-release to increment version number 0.0.1)

Activities:

  • Implement semantic-release (the same that Substrait project use)
  • Implement Java artifact publishing (tested in locally project: release + maven publish)
  • Publish to Github packages repository (production)
  • Testing local project consuming Github packages repository (production)
  • Publish to Archiva / Nexus / Other repository (staging)
  • Testing local project consuming Archiva / Nexus / Other repository (staging)
  • Move from Staging to Release Maven Central (production)
  • Testing publish to release Maven Central (production)
  • Setup schedule for workflows needed (i.e.: release every weekend, ...)
  • Document process for: Release / Development

@CLAassistant
Copy link

CLAassistant commented Oct 27, 2022

CLA assistant check
All committers have signed the CLA.

@davisusanibar
Copy link
Contributor Author

This is some example about how do we could use Substrait Java Core or Isthmus for GitHub Packages:

PD: This fork repository https://maven.pkg.github.com/daviddalisusanibararce/substrait-java was used for testing purpose, at the end it should be https://github.com/substrait-io/substrait-java.

For this process is only needed to create GITHUB_TOKEN with repo, write:packages grant access.

  1. The release process are running: ./gradlew publish -Pversion=1.0.0

Artifacts:

Release:
https://github.com/daviddalisusanibararce/substrait-java/releases/tag/v1.0.0

  1. Use from Gradle projects:
    build.gradle
repositories {
    mavenCentral()
    maven {
        url = uri("https://maven.pkg.github.com/daviddalisusanibararce/substrait-java")
        credentials {
            username = "your_github_user"
            password = "your_github_token"
        }
    }
}
dependencies {
    implementation 'io.substrait:core:1.0.0'
    implementation 'io.substrait:isthmus:1.0.0'
}
  1. Use from Maven projects:
    ~/.m2/settings.xml
<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
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>github</id>
      <username>your_github_user</username>
      <password>your_github_token</password>
    </server>
  </servers>
</settings>

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>use-kts-pproject</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

    <repositories>
        <repository>
            <id>github</id>
            <url>https://maven.pkg.github.com/daviddalisusanibararce/substrait-java</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>io.substrait</groupId>
            <artifactId>core</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>io.substrait</groupId>
            <artifactId>isthmus</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
</project>

@davisusanibar
Copy link
Contributor Author

To continue testing with Archiva or Nexus or Other repository, please your support to provide:

  1. Server URL for release / snapshot versions
  2. Create repository secret with the user value with this key NEXUS_USERNAME
  3. Create repository secret with the password value with this key NEXUS_PASSWORD

@jacques-n
Copy link
Collaborator

Thanks for putting this together. I suggest we do bite size patches rather than large patches. E.g.: semantic commits is a patch, maven snapshot deploy is a patch, maven release deploy is patch, etc.

For the repos, I've already secured the maven central substrait ossrh repo. I'm inclined to use that so people don't have to add extra repositories to consume stubstrait. Is there a reason we shouldn't do that?

@davisusanibar
Copy link
Contributor Author

Thanks for putting this together. I suggest we do bite size patches rather than large patches. E.g.: semantic commits is a patch, maven snapshot deploy is a patch, maven release deploy is patch, etc.

For the repos, I've already secured the maven central substrait ossrh repo. I'm inclined to use that so people don't have to add extra repositories to consume stubstrait. Is there a reason we shouldn't do that?

OSSRH is ok (this was tested locally also with Sonatype Nexus Repository Manager OSS 3.42.0-01). Related to GitHub Packages could be enabled/disabled on demand as it is ready for use as needed and was used for PoC.

@davisusanibar
Copy link
Contributor Author

Thanks for putting this together. I suggest we do bite size patches rather than large patches. E.g.: semantic commits is a patch, maven snapshot deploy is a patch, maven release deploy is patch, etc.
For the repos, I've already secured the maven central substrait ossrh repo. I'm inclined to use that so people don't have to add extra repositories to consume stubstrait. Is there a reason we shouldn't do that?

OSSRH is ok (this was tested locally also with Sonatype Nexus Repository Manager OSS 3.42.0-01). Related to GitHub Packages could be enabled/disabled on demand as it is ready for use as needed and was used for PoC.

Oh, sorry, related to do bite size patches, let me divide this PR on this manner.

@jacques-n
Copy link
Collaborator

jacques-n commented Nov 9, 2022

Would be great for the next bitesize patch to be push to OSSRH.

@davisusanibar
Copy link
Contributor Author

Would be great for the next bitesize patch to be push to OSSRH.

Just sent #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants