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

Backport main changes to 1.x #93

Merged
merged 7 commits into from
Nov 6, 2021
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
15 changes: 2 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,14 @@ jobs:
with:
java-version: ${{ matrix.java }}

# dependencies: OpenSearch
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.x'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal

# common-utils
- name: Build and Test
run: |
./gradlew build -Dopensearch.version=1.1.0-SNAPSHOT
./gradlew build -Dopensearch.version=1.2.0-SNAPSHOT

- name: Publish to Maven Local
run: |
./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
./gradlew publishToMavenLocal -Dopensearch.version=1.2.0-SNAPSHOT

- name: Upload Coverage Report
uses: codecov/codecov-action@v1
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/push-common-utils-jar.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://opensearch.org/assets/brand/SVG/Logo/opensearch_logo_default.svg" height="64px"/>
<img src="https://opensearch.org/assets/img/opensearch-logo-themed.svg" height="64px">

- [OpenSearch Common Utils](#opensearch-common-utils)
- [Contributing](#contributing)
Expand Down Expand Up @@ -44,4 +44,4 @@ This project is licensed under the [Apache v2.0 License](LICENSE.txt).

## Copyright

Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details.
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
buildscript {
ext {
opensearch_group = "org.opensearch"
opensearch_version = System.getProperty("opensearch.version", "1.1.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "1.2.0-SNAPSHOT")
kotlin_version = System.getProperty("kotlin.version", "1.4.32")
}

Expand All @@ -21,6 +21,7 @@ buildscript {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
}

dependencies {
Expand All @@ -42,6 +43,7 @@ repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
}

ext {
Expand Down Expand Up @@ -155,8 +157,13 @@ task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc.destinationDir
}

publishing {
repositories {
maven {
name = 'staging'
url = "${rootProject.buildDir}/local-staging-repo"
}
}
publications {
shadow(MavenPublication) {
project.shadow.component(it)
Expand Down Expand Up @@ -195,9 +202,4 @@ publishing {

gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
gradle.startParameter.setLogLevel(LogLevel.DEBUG)

signing {
required { gradle.taskGraph.hasTask("publishShadowPublicationToSonatype-stagingRepository") }
sign publishing.publications.shadow
}
}
14 changes: 14 additions & 0 deletions release-notes/opensearch-common-utils.release-notes-1.2.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Version 1.2.0.0 2021-11-05

Compatible with OpenSearch 1.2.0

### Infrastructure

* Updates common-utils version to 1.2 ([#77](https://github.com/opensearch-project/common-utils/pull/77))
* Update maven publication to include cksums. ([#91](https://github.com/opensearch-project/common-utils/pull/91))

### Documentation

* Add themed logo to README ([#41](https://github.com/opensearch-project/common-utils/pull/41))
* Update copyright notice ([#90](https://github.com/opensearch-project/common-utils/pull/90))
* Add release notes for version 1.2.0.0 ([#92](https://github.com/opensearch-project/common-utils/pull/92))
62 changes: 62 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

# Copyright OpenSearch Contributors.
# SPDX-License-Identifier: Apache-2.0

set -ex

function usage() {
echo "Usage: $0 [args]"
echo ""
echo "Arguments:"
echo -e "-v VERSION\t[Required] OpenSearch version."
echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'."
echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored."
echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'."
echo -e "-h help"
}

while getopts ":h:v:s:o:a:" arg; do
case $arg in
h)
usage
exit 1
;;
v)
VERSION=$OPTARG
;;
s)
SNAPSHOT=$OPTARG
;;
o)
OUTPUT=$OPTARG
;;
a)
ARCHITECTURE=$OPTARG
;;
:)
echo "Error: -${OPTARG} requires an argument"
usage
exit 1
;;
?)
echo "Invalid option: -${arg}"
exit 1
;;
esac
done

if [ -z "$VERSION" ]; then
echo "Error: You must specify the OpenSearch version"
usage
exit 1
fi

[[ "$SNAPSHOT" == "true" ]] && VERSION=$VERSION-SNAPSHOT
[ -z "$OUTPUT" ] && OUTPUT=artifacts

./gradlew build -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
./gradlew publishShadowPublicationToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
./gradlew publishShadowPublicationToStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
mkdir -p $OUTPUT/maven/org/opensearch
cp -r ./build/local-staging-repo/org/opensearch/common-utils $OUTPUT/maven/org/opensearch/common-utils