Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/maven-publish-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish unified query modules to maven

on:
workflow_dispatch:
push:
branches:
- main
- 1.*
- 2.*
- feature/unified-ppl # Temporarily added for testing

env:
SNAPSHOT_REPO_URL: https://aws.oss.sonatype.org/content/repositories/snapshots/

jobs:
publish-unified-query-modules:
strategy:
fail-fast: false
if: github.repository == 'opensearch-project/sql'
runs-on: ubuntu-latest

permissions:
id-token: write
contents: write

steps:
- uses: actions/setup-java@v3
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 21
- uses: actions/checkout@v3
- uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
aws-region: us-east-1

- name: get credentials
run: |
# Get credentials for publishing
.github/get-sonatype-credentials.sh

- name: publish unified query modules to maven
run: |
./gradlew publishUnifiedQueryPublicationToSnapshotsRepository
46 changes: 46 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,52 @@ subprojects {
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }
maven { url 'https://jitpack.io' }
}

// Publish internal modules as Maven artifacts for external use, such as by opensearch-spark and opensearch-cli.
def publishedModules = ['sql', 'ppl', 'core', 'opensearch', 'common', 'protocol']
if (publishedModules.contains(name)) {
apply plugin: 'java-library'
apply plugin: 'maven-publish'

def fullArtifactId = "unified-query-${project.name}"
publishing {
publications {
unifiedQuery(MavenPublication) {
from components.java
groupId = "org.opensearch.query"
artifactId = fullArtifactId

pom {
name = fullArtifactId
description = "OpenSearch unified query ${project.name} module"
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'OpenSearch'
url = 'https://github.com/opensearch-project/sql'
}
}
}
}
}

repositories {
maven {
name = "Snapshots"
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
credentials {
username = "$System.env.SONATYPE_USERNAME"
password = "$System.env.SONATYPE_PASSWORD"
}
}
}
}
}
}

// TODO: fix compiler warnings
Expand Down
Loading