Skip to content

Commit

Permalink
Backport main changes to 1.x (opensearch-project#93)
Browse files Browse the repository at this point in the history
* Add themed logo to README (opensearch-project#41)

Signed-off-by: Miki <[email protected]>

* Updates common-utils version to 1.2 (opensearch-project#77)

* Updates common-utils version to 1.2 and Uses Maven for 1.2 dependencies

Signed-off-by: Clay Downs <[email protected]>

* Publish .md5 and .sha1 signatures. (opensearch-project#79) (opensearch-project#80)

* Publish .md5 and .sha1 signatures.

Signed-off-by: dblock <[email protected]>

* Use OpenSearch 1.1.

Signed-off-by: dblock <[email protected]>

* Publish source and javadoc checksums. (opensearch-project#81)

Signed-off-by: dblock <[email protected]>

* Update copyright notice (opensearch-project#90)

Signed-off-by: Mohammad Qureshi <[email protected]>

* Update maven publication to include cksums. (opensearch-project#91)

This change adds a local staging repo task that will include cksums.  It will also update build.sh to use this new task and copy the contents of the staging repo to the output directory.
The maven publish plugin will not include these cksums when publishing to maven local but will when published to a separate folder.

Signed-off-by: Marc Handalian <[email protected]>

* Add release notes for version 1.2.0.0 (opensearch-project#92)

* Add release notes for version 1.2.0.0

Signed-off-by: Ashish Agrawal <[email protected]>

Co-authored-by: Miki <[email protected]>
Co-authored-by: Clay Downs <[email protected]>
Co-authored-by: Daniel Doubrovkine (dB.) <[email protected]>
Co-authored-by: Mohammad Qureshi <[email protected]>
Co-authored-by: Marc Handalian <[email protected]>
  • Loading branch information
6 people authored Nov 6, 2021
1 parent 8da2031 commit 2430990
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 66 deletions.
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

0 comments on commit 2430990

Please sign in to comment.